├── .gitignore ├── resources ├── demo.gif ├── demo.png └── logo.png ├── .github ├── FUNDING.yml ├── dependabot.yml └── workflows │ ├── build.yml │ ├── e2e-test.yml │ ├── rebase.yml │ ├── release-pr.yml │ ├── release.yml │ └── release-binary-assets.yml ├── release-plz.toml ├── snap └── snapcraft.yaml ├── Cargo.toml ├── src ├── cleaner.rs ├── decider.rs ├── bin │ └── putzen.rs └── lib.rs ├── cliff.toml ├── README.md ├── CHANGELOG.md ├── Cargo.lock └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /resources/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sassman/putzen-rs/HEAD/resources/demo.gif -------------------------------------------------------------------------------- /resources/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sassman/putzen-rs/HEAD/resources/demo.png -------------------------------------------------------------------------------- /resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sassman/putzen-rs/HEAD/resources/logo.png -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: sassman 4 | -------------------------------------------------------------------------------- /release-plz.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | changelog_config = "cliff.toml" 3 | changelog_update = true 4 | git_tag_enable = true 5 | publish = false 6 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: cargo 4 | directory: "/" 5 | schedule: 6 | interval: weekly 7 | day: friday 8 | time: "15:00" 9 | timezone: Europe/Berlin 10 | open-pull-requests-limit: 10 11 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | on: 3 | push: 4 | branches: ["*"] 5 | paths-ignore: 6 | - "**/docs/**" 7 | - "**.md" 8 | pull_request: 9 | branches: [main] 10 | workflow_dispatch: 11 | workflow_call: 12 | 13 | jobs: 14 | build: 15 | uses: sassman/.github/.github/workflows/build.yml@main 16 | 17 | coverage: 18 | name: code coverage 19 | uses: sassman/.github/.github/workflows/coverage.yml@main 20 | secrets: 21 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} 22 | -------------------------------------------------------------------------------- /.github/workflows/e2e-test.yml: -------------------------------------------------------------------------------- 1 | name: e2e test 2 | on: 3 | schedule: 4 | - cron: "0 18 * * 5" 5 | 6 | # NOTE: needs to stay in sync with ./build.yml 7 | jobs: 8 | check: 9 | name: check 10 | strategy: 11 | fail-fast: false 12 | matrix: 13 | version: ["macos-latest", "ubuntu-latest", "windows-latest"] 14 | runs-on: ${{ matrix.version }} 15 | steps: 16 | - name: setup | rust 17 | uses: dtolnay/rust-toolchain@stable 18 | - run: cargo install -f putzen-cli 19 | - run: putzen --help 20 | -------------------------------------------------------------------------------- /snap/snapcraft.yaml: -------------------------------------------------------------------------------- 1 | name: putzen 2 | base: core22 3 | adopt-info: putzen 4 | summary: clean build and dependency artifacts safely 5 | description: | 6 | "putzen" is German and means cleaning. 7 | It helps keeping your disk clean of build and dependency artifacts safely. 8 | 9 | grade: stable 10 | confinement: strict 11 | 12 | parts: 13 | putzen: 14 | plugin: rust 15 | source: . 16 | override-pull: | 17 | snapcraftctl pull 18 | snapcraftctl set-version "$(git describe --tags)" 19 | 20 | apps: 21 | putzen: 22 | command: bin/putzen 23 | plugs: 24 | - home 25 | -------------------------------------------------------------------------------- /.github/workflows/rebase.yml: -------------------------------------------------------------------------------- 1 | name: Automatic Rebase 2 | on: 3 | issue_comment: 4 | types: [created] 5 | jobs: 6 | rebase: 7 | name: Rebase 8 | if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout the latest code 12 | uses: actions/checkout@v4 13 | with: 14 | token: ${{ secrets.GH_PAT }} 15 | fetch-depth: 0 # otherwise, you will fail to push refs to dest repo 16 | - name: Automatic Rebase 17 | uses: cirrus-actions/rebase@1.4 18 | env: 19 | GITHUB_TOKEN: ${{ secrets.GH_PAT }} 20 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "putzen-cli" 3 | description = "helps keeping your disk clean of build and dependency artifacts safely" 4 | version = "2.0.2" 5 | authors = ["Sven Kanoldt "] 6 | edition = "2021" 7 | license = "GPL-3.0-only" 8 | keywords = ["commandline", "cleanup"] 9 | categories = ["command-line-utilities"] 10 | repository = "https://github.com/sassman/putzen-rs" 11 | include = ["src/**/*", "LICENSE", "*.md"] 12 | 13 | [dependencies] 14 | argh = "0.1" 15 | dialoguer = "0.12" 16 | jwalk = "0.8" 17 | 18 | [dev-dependencies] 19 | tempfile = "3" 20 | 21 | [target.'cfg(target_family = "windows")'.dependencies] 22 | remove_dir_all = "1.0.0" 23 | 24 | [[bin]] 25 | name = "putzen" 26 | path = "src/bin/putzen.rs" 27 | -------------------------------------------------------------------------------- /.github/workflows/release-pr.yml: -------------------------------------------------------------------------------- 1 | ## See https://release-plz.ieni.dev/docs/github/quickstart 2 | 3 | name: Release PR 4 | 5 | permissions: 6 | pull-requests: write 7 | contents: write 8 | 9 | on: 10 | push: 11 | branches: 12 | - main 13 | workflow_dispatch: 14 | 15 | jobs: 16 | release-plz: 17 | name: Release-plz 18 | runs-on: ubuntu-latest 19 | steps: 20 | - name: Checkout repository 21 | uses: actions/checkout@v4 22 | with: 23 | fetch-depth: 0 24 | token: ${{ secrets.GITHUB_TOKEN }} 25 | - name: Install Rust toolchain 26 | uses: dtolnay/rust-toolchain@stable 27 | - name: Run release-plz pr 28 | uses: MarcoIeni/release-plz-action@v0.5 29 | with: 30 | command: release-pr 31 | config: release-plz.toml 32 | env: 33 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 34 | -------------------------------------------------------------------------------- /src/cleaner.rs: -------------------------------------------------------------------------------- 1 | #[cfg(target_family = "windows")] 2 | use remove_dir_all::remove_dir_all; 3 | 4 | #[cfg(not(target_family = "windows"))] 5 | use std::fs::remove_dir_all; 6 | 7 | use std::io::Result; 8 | use std::path::Path; 9 | 10 | pub enum Clean { 11 | Cleaned, 12 | NotCleaned, 13 | } 14 | 15 | pub trait DoCleanUp { 16 | fn do_cleanup(&self, path_to_remove: &Path) -> Result; 17 | } 18 | 19 | #[derive(Default)] 20 | pub struct ProperCleaner; 21 | impl DoCleanUp for ProperCleaner { 22 | fn do_cleanup(&self, path_to_remove: &Path) -> Result { 23 | remove_dir_all(path_to_remove).map(|_| Clean::Cleaned) 24 | } 25 | } 26 | 27 | #[derive(Default)] 28 | pub struct DryRunCleaner; 29 | impl DoCleanUp for DryRunCleaner { 30 | /// dry run means do nothing but printing 31 | fn do_cleanup(&self, _: &Path) -> Result { 32 | Ok(Clean::NotCleaned) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/decider.rs: -------------------------------------------------------------------------------- 1 | use dialoguer::theme::ColorfulTheme; 2 | use dialoguer::Confirm; 3 | use std::io::Result; 4 | use std::path::PathBuf; 5 | 6 | #[derive(Clone, Copy)] 7 | pub enum Decision { 8 | Yes, 9 | No, 10 | Quit, 11 | } 12 | 13 | #[derive(Clone, Default)] 14 | pub struct DecisionContext { 15 | pub is_dry_run: bool, 16 | pub yes_to_all: bool, 17 | pub working_dir: PathBuf, 18 | } 19 | 20 | impl DecisionContext { 21 | pub fn println(&self, msg: impl AsRef) { 22 | println!("{}", msg.as_ref()); 23 | } 24 | } 25 | 26 | pub trait Decide { 27 | fn obtain_decision( 28 | &mut self, 29 | ctx: &DecisionContext, 30 | question: impl AsRef, 31 | ) -> Result; 32 | } 33 | 34 | #[derive(Default)] 35 | pub struct NiceInteractiveDecider { 36 | decision_memory: Option, 37 | } 38 | 39 | impl Decide for NiceInteractiveDecider { 40 | fn obtain_decision( 41 | &mut self, 42 | ctx: &DecisionContext, 43 | question: impl AsRef, 44 | ) -> Result { 45 | let suffix = if ctx.is_dry_run { " [dry-run]" } else { "" }; 46 | Ok(self.decision_memory.as_ref().copied().unwrap_or_else(|| { 47 | if ctx.yes_to_all { 48 | ctx.println(format!(" {}{suffix} [yes by -y arg]", question.as_ref())); 49 | Decision::Yes 50 | } else { 51 | Confirm::with_theme(&ColorfulTheme::default()) 52 | .with_prompt(format!("{}{suffix}", question.as_ref())) 53 | .default(false) 54 | .show_default(true) 55 | .wait_for_newline(false) 56 | .interact_opt() 57 | .unwrap() 58 | .map(|x| if x { Decision::Yes } else { Decision::No }) 59 | .unwrap_or(Decision::Quit) 60 | } 61 | })) 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | ## references: 2 | # audit: https://github.com/actions-rs/audit-check 3 | # "needs": https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idneeds 4 | 5 | name: Release 6 | on: 7 | push: 8 | tags: 9 | - "v[0-9]+.[0-9]+.[0-9]+" 10 | - "v[0-9]+.[0-9]+.[0-9]-alpha.[0-9]+" 11 | - "v[0-9]+.[0-9]+.[0-9]-beta.[0-9]+" 12 | paths-ignore: 13 | - "**/docs/**" 14 | - "**.md" 15 | 16 | # NOTE: needs to stay in sync with ./build.yml 17 | jobs: 18 | # call out to build.yml 19 | doing-a-build: 20 | uses: sassman/putzen-rs/.github/workflows/build.yml@main 21 | 22 | publish: 23 | name: post / cargo publish 24 | needs: doing-a-build 25 | runs-on: ubuntu-latest 26 | steps: 27 | - uses: actions/checkout@v4 28 | - name: setup | rust 29 | uses: dtolnay/rust-toolchain@stable 30 | - uses: katyo/publish-crates@v1 31 | with: 32 | registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} 33 | 34 | # https://github.com/marketplace/actions/changelog-reader 35 | release: 36 | name: post / github release 37 | needs: publish 38 | runs-on: ubuntu-latest 39 | steps: 40 | - uses: actions/checkout@v4 41 | - name: setup | rust 42 | uses: dtolnay/rust-toolchain@stable 43 | - name: Get version from tag 44 | id: tag_name 45 | run: | 46 | echo "current_version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT 47 | shell: bash 48 | - name: Get Changelog Entry 49 | id: changelog_reader 50 | uses: mindsers/changelog-reader-action@v2 51 | with: 52 | validation_depth: 10 53 | version: ${{ steps.tag_name.outputs.current_version }} 54 | path: ./CHANGELOG.md 55 | - name: Create Release 56 | id: create_release 57 | uses: ncipollo/release-action@v1 58 | env: 59 | GITHUB_TOKEN: ${{ secrets.GH_PAT }} 60 | with: 61 | # This pulls from the "Get Changelog Entry" step above, referencing it's ID to get its outputs object. 62 | # See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps 63 | name: Release ${{ steps.changelog_reader.outputs.version }} 64 | body: ${{ steps.changelog_reader.outputs.changes }} 65 | prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }} 66 | draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }} 67 | -------------------------------------------------------------------------------- /cliff.toml: -------------------------------------------------------------------------------- 1 | # configuration file for git-cliff (0.1.0) 2 | 3 | [changelog] 4 | # changelog header 5 | header = """ 6 | # Changelog 7 | All notable changes to this project will be documented in this file. 8 | 9 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 10 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 11 | 12 | """ 13 | # template for the changelog body 14 | # https://tera.netlify.app/docs/#introduction 15 | body = """ 16 | {% if version %}\ 17 | ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} 18 | [{{ version | trim_start_matches(pat="v") }}]: https://github.com/sassman/putzen-rs/compare/{{ previous.version }}...{{ version }} 19 | {% else %}\ 20 | ## [unreleased] 21 | [Unreleased]: https://github.com/sassman/putzen-rs/compare/{{ version }}...HEAD 22 | {% endif %}\ 23 | {% for group, commits in commits | group_by(attribute="group") %} 24 | ### {{ group | upper_first }} 25 | {% for commit in commits %} 26 | - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\ 27 | {% endfor %} 28 | {% endfor %}\n 29 | """ 30 | # remove the leading and trailing whitespaces from the template 31 | trim = true 32 | # changelog footer 33 | footer = """ 34 | 35 | """ 36 | 37 | [git] 38 | # parse the commits based on https://www.conventionalcommits.org 39 | conventional_commits = true 40 | # filter out the commits that are not conventional 41 | filter_unconventional = true 42 | # process each line of a commit as an individual commit 43 | split_commits = false 44 | # regex for parsing and grouping commits 45 | commit_parsers = [ 46 | { message = "^feat", group = "Features"}, 47 | { message = "^fix", group = "Bug Fixes"}, 48 | { message = "^doc", group = "Documentation"}, 49 | { message = "^perf", group = "Performance"}, 50 | { message = "^refactor", group = "Refactor"}, 51 | { message = "^style", group = "Styling"}, 52 | { message = "^test", group = "Testing"}, 53 | { message = "^chore\\(release\\): prepare for", skip = true}, 54 | { message = "^chore", group = "Miscellaneous Tasks"}, 55 | { body = ".*security", group = "Security"}, 56 | ] 57 | # protect breaking changes from being skipped due to matching a skipping commit_parser 58 | protect_breaking_commits = false 59 | # filter out the commits that are not matched by commit parsers 60 | filter_commits = true 61 | # glob pattern for matching git tags 62 | tag_pattern = "v[0-9]*" 63 | # regex for skipping tags 64 | skip_tags = "v0.1.0-beta.1" 65 | # regex for ignoring tags 66 | ignore_tags = "" 67 | # sort the tags topologically 68 | topo_order = false 69 | # sort the commits inside sections by oldest/newest order 70 | sort_commits = "newest" 71 | -------------------------------------------------------------------------------- /.github/workflows/release-binary-assets.yml: -------------------------------------------------------------------------------- 1 | name: Release Binary Assets 2 | on: 3 | release: 4 | types: 5 | - published 6 | workflow_dispatch: 7 | 8 | jobs: 9 | release: 10 | runs-on: ${{ matrix.os }} 11 | strategy: 12 | fail-fast: false 13 | matrix: 14 | include: 15 | - target: x86_64-unknown-linux-musl 16 | os: ubuntu-latest 17 | cross: true 18 | binName: putzen 19 | - target: aarch64-unknown-linux-musl 20 | os: ubuntu-latest 21 | cross: true 22 | binName: putzen 23 | - target: x86_64-apple-darwin 24 | os: macos-latest 25 | cross: false 26 | binName: putzen 27 | - target: x86_64-pc-windows-msvc 28 | os: windows-latest 29 | cross: false 30 | binName: putzen.exe 31 | - target: x86_64-pc-windows-gnu 32 | os: windows-latest 33 | cross: false 34 | binName: putzen.exe 35 | steps: 36 | - uses: actions/checkout@v4 37 | - name: setup | rust 38 | uses: dtolnay/rust-toolchain@stable 39 | with: 40 | targets: ${{ matrix.target }} 41 | - uses: Swatinem/rust-cache@v2 42 | - uses: taiki-e/install-action@v2 43 | if: ${{ matrix.cross == true }} 44 | with: 45 | tool: cross 46 | - name: build with cross 47 | if: ${{ matrix.cross == true }} 48 | shell: bash 49 | run: cross build --locked --release --target ${{ matrix.target }} 50 | - name: smoke test 51 | if: ${{ matrix.cross == true }} 52 | shell: bash 53 | run: | 54 | cross run --locked --release --target ${{ matrix.target }} -- --help 55 | - name: build with cargo 56 | if: ${{ matrix.cross != true }} 57 | shell: bash 58 | run: cargo build --locked --release --target ${{ matrix.target }} 59 | - name: smoke test with cargo 60 | if: ${{ matrix.cross != true }} 61 | shell: bash 62 | run: | 63 | cargo run --locked --release --target ${{ matrix.target }} -- --help 64 | - name: Create Archive 65 | id: archive 66 | shell: bash 67 | env: 68 | TARGET: ${{ matrix.target }} 69 | TAG: ${{ github.event.release.tag_name }} 70 | run: | 71 | filename="putzen-$TAG-$TARGET.tar.gz" 72 | tar -czvf "$filename" README.md LICENSE -C "target/$TARGET/release" "${{ matrix.binName }}" 73 | echo "filename=$filename" >> $GITHUB_OUTPUT 74 | - name: Upload Archive 75 | uses: ncipollo/release-action@v1.8.7 76 | with: 77 | token: ${{ secrets.GITHUB_TOKEN }} 78 | allowUpdates: true 79 | artifactErrorsFailBuild: true 80 | artifacts: ${{ steps.archive.outputs.filename }} 81 | artifactContentType: application/octet-stream 82 | omitBodyDuringUpdate: true 83 | omitNameDuringUpdate: true 84 | omitPrereleaseDuringUpdate: true 85 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 |

Putzen

4 | 5 | [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) 6 | [![crates.io](https://img.shields.io/crates/v/putzen-cli.svg)](https://crates.io/crates/putzen-cli) 7 | [![dependency status](https://deps.rs/repo/github/sassman/putzen-rs/status.svg)](https://deps.rs/repo/github/sassman/putzen-rs) 8 | [![Build Status](https://github.com/sassman/putzen-rs/workflows/Build/badge.svg)](https://github.com/sassman/putzen-rs/actions?query=branch%3Amain+workflow%3ABuild+) 9 | [![LOC](https://tokei.rs/b1/github/sassman/putzen-rs?category=code)](https://tokei.rs/b1/github/sassman/putzen-rs?category=code) 10 | 11 | "putzen" is German and means cleaning. It helps keeping your disk clean of build and dependency artifacts safely. 12 | 13 | ![demo](resources/demo.gif) 14 | 15 |
16 | 17 | ## About 18 | 19 | In short, putzen solves the problem of cleaning up build or dependency artifacts. 20 | It does so by a simple "File" -> "Folder" rule. If the "File" and "Folder" is present, it cleans "Folder" 21 | 22 | It also does all this fast, means in parallel (if the filesystem supports it). 23 | 24 | ### Supported Artifacts 25 | 26 | putzen supports cleaning artifacts for: 27 | 28 | | type | file that is checked | folder that is cleaned | 29 | |------------|----------------------|------------------------| 30 | | rust | Cargo.toml | target | 31 | | javascript | package.json | node_modules | 32 | | CMake | CMakeLists.txt | build | 33 | 34 | furthermore, it does also support: 35 | - It can do run a dry-run (`-d`) 36 | - Interactive asking for deletion 37 | - Sums up the space that will be freed 38 | 39 | ## Quick Start 40 | 41 | ### Install 42 | 43 | ### On Linux as snap 44 | 45 | [![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/putzen) 46 | 47 | - installation [for Linux Mint](https://snapcraft.io/install/putzen/mint) 48 | - installation [for Arch Linux](https://snapcraft.io/install/putzen/arch) 49 | 50 | *TL;DR:* 51 | ```sh 52 | sudo snap install putzen 53 | ``` 54 | 55 | ### With cargo 56 | 57 | To install the `putzen`, you just need to run 58 | 59 | ```sh 60 | cargo install putzen-cli 61 | ``` 62 | 63 | **Note** the binary is called `putzen` (without `-cli`) 64 | 65 | to verify if the installation was successful, you can run `which putzen` that should output similar to 66 | 67 | ```sh 68 | $HOME/.cargo/bin/putzen 69 | ``` 70 | 71 | ### Usage 72 | 73 | ```sh 74 | $ putzen --help 75 | 76 | Usage: putzen [-v] [-d] [-y] [-L] [-a] 77 | 78 | help keeping your disk clean of build and dependency artifacts 79 | 80 | Positional Arguments: 81 | folder path where to start with disk clean up. 82 | 83 | Options: 84 | -v, --version show the version number 85 | -d, --dry-run dry-run will never delete anything, good for simulations 86 | -y, --yes-to-all switch to say yes to all questions 87 | -L, --follow follow symbolic links 88 | -a, --dive-into-hidden-folders 89 | dive into hidden folders too, e.g. `.git` 90 | --help display usage information 91 | ``` 92 | 93 | ## Alternative Projects 94 | 95 | - [kondo](https://github.com/tbillington/kondo) 96 | 97 | ## License 98 | 99 | - **[GNU GPL v3 license](https://www.gnu.org/licenses/gpl-3.0)** 100 | - Copyright 2019 - 2023 © [Sven Kanoldt](https://d34dl0ck.me) 101 | - Logo - [Clean icons created by photo3idea_studio - Flaticon](https://www.flaticon.com/free-icons/clean) -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 5 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 | 7 | ## [2.0.2] - 2025-11-04 8 | [2.0.2]: https://github.com/sassman/putzen-rs/compare/2.0.1...2.0.2 9 | 10 | ### Miscellaneous Tasks 11 | 12 | - Reduce code clutter ([#49](https://github.com/sassman/putzen-rs/pull/49)) 13 | 14 | ### Security 15 | 16 | - Bump tempfile from 3.21.0 to 3.23.0 ([#54](https://github.com/sassman/putzen-rs/pull/54)) 17 | - Bump tempfile from 3.20.0 to 3.21.0 ([#51](https://github.com/sassman/putzen-rs/pull/51)) 18 | - Bump dialoguer from 0.11.0 to 0.12.0 ([#52](https://github.com/sassman/putzen-rs/pull/52)) 19 | 20 | 21 | 22 | ## [2.0.1] - 2025-07-13 23 | [2.0.1]: https://github.com/sassman/putzen-rs/compare/2.0.0...2.0.1 24 | 25 | ### Miscellaneous Tasks 26 | 27 | - Update dependencies ([#48](https://github.com/sassman/putzen-rs/pull/48)) 28 | 29 | 30 | ## [2.0.0] - 2025-03-11 31 | [2.0.0]: https://github.com/sassman/putzen-rs/compare/1.0.10...2.0.0 32 | 33 | ### Bug Fixes 34 | 35 | - Introduce a deprecation instead of hard removing ([#42](https://github.com/sassman/putzen-rs/pull/42)) 36 | - Fix missing folders (see #38) ([#40](https://github.com/sassman/putzen-rs/pull/40)) 37 | 38 | 39 | ## [1.0.10] - 2025-03-08 40 | [1.0.10]: https://github.com/sassman/putzen-rs/compare/1.0.9...1.0.10 41 | 42 | ### Miscellaneous Tasks 43 | 44 | - Update several dependencies ([#39](https://github.com/sassman/putzen-rs/pull/39)) 45 | 46 | 47 | ## [1.0.9] - 2024-10-31 48 | [1.0.9]: https://github.com/sassman/putzen-rs/compare/1.0.8...1.0.9 49 | 50 | ### Miscellaneous Tasks 51 | 52 | - Update dependencies + update ci ([#32](https://github.com/sassman/putzen-rs/pull/32)) 53 | 54 | 55 | 56 | ## [1.0.8] - 2024-07-15 57 | [1.0.8]: https://github.com/sassman/putzen-rs/compare/1.0.7...1.0.8 58 | 59 | ### Miscellaneous Tasks 60 | 61 | - Update dependencies ([#26](https://github.com/sassman/putzen-rs/pull/26)) 62 | 63 | ## [1.0.7] - 2023-01-21 64 | [1.0.7]: https://github.com/sassman/putzen-rs/compare/v1.0.6...v1.0.7 65 | 66 | ### Build 67 | 68 | - [bump dialoguer from 0.10.2 to 0.10.3](https://github.com/sassman/putzen-rs/pull/20) 69 | - [bump argh from 0.1.9 to 0.1.10](https://github.com/sassman/putzen-rs/pull/19) 70 | 71 | ### Contributors 72 | - [dependabot[bot]](https://github.com/apps/dependabot) 73 | - [sassman](https://github.com/sassman) 74 | 75 | ## [1.0.6] - 2022-12-26 76 | [1.0.6]: https://github.com/sassman/putzen-rs/compare/v1.0.5...v1.0.6 77 | 78 | ### Build 79 | 80 | - [bump jwalk from 0.6.0 to 0.8.1](https://github.com/sassman/putzen-rs/pull/17) 81 | - [bump argh from 0.1.7 to 0.1.9](https://github.com/sassman/putzen-rs/pull/16) 82 | 83 | ### Contributors 84 | - [dependabot[bot]](https://github.com/apps/dependabot) 85 | 86 | ## [1.0.5] - 2022-10-04 87 | [1.0.5]: https://github.com/sassman/putzen-rs/compare/v1.0.4...v1.0.5 88 | 89 | ### Build 90 | 91 | - [bump argh from 0.1.7 to 0.1.9](https://github.com/sassman/putzen-rs/pull/16) 92 | - [bump dialoguer from 0.10.1 to 0.10.2](https://github.com/sassman/putzen-rs/pull/15) 93 | 94 | ### Contributors 95 | - [dependabot[bot]](https://github.com/apps/dependabot) 96 | 97 | ## [1.0.4] - 2022-05-26 98 | [1.0.4]: https://github.com/sassman/putzen-rs/compare/v1.0.3...v1.0.4 99 | 100 | ### Build 101 | 102 | - Bump dialoguer from 0.10.0 to 0.10.1 (#13) 103 | - Bump dialoguer from 0.9.0 to 0.10.0 (#12) 104 | 105 | ## [1.0.3] - 2022-04-18 106 | [1.0.3]: https://github.com/sassman/putzen-rs/compare/v1.0.2...v1.0.3 107 | 108 | ### Features 109 | 110 | - Document snap installation 111 | - Add snapcraft config 112 | 113 | ### Build 114 | 115 | - Update deps + clippy fixes (#11) 116 | 117 | ## [1.0.2] - 2022-02-05 118 | [1.0.2]: https://github.com/sassman/putzen-rs/compare/v1.0.1...v1.0.2 119 | 120 | ### Bug Fixes 121 | 122 | - On windows: `UNC` paths are problematic (#9) 123 | - On windows path `.` is not recognized (#7) 124 | - Wrong heading level broke the build 125 | 126 | ### Features 127 | 128 | - Update logo + demo + README.md 129 | 130 | ### Miscellaneous Tasks 131 | 132 | - Add a changelog 133 | 134 | ## [1.0.1] - 2022-01-31 135 | [1.0.1]: https://github.com/sassman/putzen-rs/compare/v1.0.0...v1.0.1 136 | 137 | ### Features 138 | 139 | - Add `-v` and default starting folder (#4) 140 | 141 | ### Miscellaneous Tasks 142 | 143 | - Fix release-binary-assets workflow 144 | 145 | ## [1.0.0] - 2022-01-31 146 | [1.0.0]: https://github.com/sassman/putzen-rs/compare/...v1.0.0 147 | 148 | ### Features 149 | 150 | - Initial release (#3) 151 | - Add `-y` cli flag (#2) 152 | - Migrate to dialoguer for a more nice UX on the interactive part (#1) 153 | - Completing the basic feature set 154 | - Does something, but not super happy yet 155 | - Finds all files matching and prints out the delete command 156 | 157 | 158 | -------------------------------------------------------------------------------- /src/bin/putzen.rs: -------------------------------------------------------------------------------- 1 | use std::convert::TryFrom; 2 | use std::io::Result; 3 | use std::path::PathBuf; 4 | 5 | use argh::FromArgs; 6 | use jwalk::Parallelism; 7 | 8 | use putzen_cli::{ 9 | DecisionContext, DoCleanUp, DryRunCleaner, FileToFolderMatch, Folder, FolderProcessed, 10 | HumanReadable, IsFolderToRemove, NiceInteractiveDecider, ProperCleaner, 11 | }; 12 | 13 | /// all supported this to clean up 14 | static FOLDER_TO_CLEANUP: [FileToFolderMatch; 3] = [ 15 | FileToFolderMatch::new("Cargo.toml", "target"), 16 | FileToFolderMatch::new("package.json", "node_modules"), 17 | FileToFolderMatch::new("CMakeLists.txt", "build"), 18 | ]; 19 | 20 | #[derive(FromArgs)] 21 | /// help keeping your disk clean of build and dependency artifacts 22 | struct PutzenCliArgs { 23 | /// show the version number 24 | #[argh(switch, short = 'v')] 25 | version: bool, 26 | 27 | /// dry-run will never delete anything, good for simulations 28 | #[argh(switch, short = 'd')] 29 | dry_run: bool, 30 | 31 | /// switch to say yes to all questions 32 | #[argh(switch, short = 'y')] 33 | yes_to_all: bool, 34 | 35 | /// follow symbolic links 36 | #[argh(switch, short = 'L')] 37 | follow: bool, 38 | 39 | /// dive into hidden folders too, e.g. `.git` 40 | #[argh(switch, short = 'a')] 41 | dive_into_hidden_folders: bool, 42 | 43 | /// path where to start with disk clean up. 44 | #[argh(positional, default = "PathBuf::from(\".\")")] 45 | folder: PathBuf, 46 | } 47 | 48 | fn main() -> Result<()> { 49 | let args: PutzenCliArgs = argh::from_env(); 50 | if args.version { 51 | println!("{} {}", env!("CARGO_BIN_NAME"), env!("CARGO_PKG_VERSION")); 52 | Ok(()) 53 | } else { 54 | visit_path(&args) 55 | } 56 | } 57 | 58 | fn visit_path(args: &PutzenCliArgs) -> Result<()> { 59 | let to_clean = &FOLDER_TO_CLEANUP; 60 | let mut decider = NiceInteractiveDecider::default(); 61 | let mut amount_cleaned = 0; 62 | let folder = args 63 | .folder 64 | .canonicalize() 65 | .expect("Folder cannot be canonicalized."); 66 | let ctx = DecisionContext { 67 | working_dir: folder.clone(), 68 | is_dry_run: args.dry_run, 69 | yes_to_all: args.yes_to_all, 70 | }; 71 | 72 | let cleaner: Box = if args.dry_run { 73 | Box::new(DryRunCleaner) 74 | } else { 75 | Box::new(ProperCleaner) 76 | }; 77 | 78 | ctx.println(format!("Start cleaning at {}", folder.display())); 79 | for folder in jwalk::WalkDirGeneric::<((), Option)>::new(folder) 80 | .skip_hidden(!args.dive_into_hidden_folders) 81 | .follow_links(args.follow) 82 | .parallelism(Parallelism::RayonNewPool(8)) 83 | .process_read_dir(move |_, _, _, children| { 84 | children.retain(|dir_entry_result| { 85 | dir_entry_result 86 | .as_ref() 87 | .map(|dir| dir.path().is_dir()) 88 | .unwrap_or(false) 89 | }); 90 | 91 | children.iter_mut().for_each(|child| { 92 | if let Ok(child) = child { 93 | if let Ok(folder) = Folder::try_from(child.path()) { 94 | for rule in to_clean { 95 | if rule.is_folder_to_remove(&folder) { 96 | child.client_state = Some(folder); 97 | child.read_children_path = None; 98 | return; 99 | } 100 | } 101 | } 102 | } 103 | }); 104 | }) 105 | .into_iter() 106 | .filter_map(|f| f.ok()) 107 | .filter_map(|f| f.client_state) 108 | { 109 | 'rules: for rule in to_clean { 110 | let result = folder.accept(&ctx, rule, &*cleaner, &mut decider); 111 | match result { 112 | Ok(FolderProcessed::Abort) => return Ok(()), 113 | Ok(FolderProcessed::Cleaned(size)) => { 114 | amount_cleaned += size; 115 | continue 'rules; 116 | } 117 | Ok(FolderProcessed::NoRuleMatch) => continue 'rules, 118 | Ok(FolderProcessed::Skipped) => continue 'rules, 119 | Err(error) => return Err(error), 120 | }; 121 | } 122 | } 123 | 124 | if amount_cleaned > 0 { 125 | ctx.println(format!("Freed: {}", amount_cleaned.as_human_readable())); 126 | } else { 127 | ctx.println("No space freed ;-("); 128 | } 129 | 130 | Ok(()) 131 | } 132 | 133 | #[cfg(test)] 134 | mod tests { 135 | use super::*; 136 | 137 | #[test] 138 | fn test_e2e_scenario() { 139 | let root_folder = tempfile::TempDir::new().unwrap(); 140 | let target_folder = root_folder.path().join("target"); 141 | std::fs::create_dir(&target_folder).unwrap(); 142 | std::fs::File::create(root_folder.path().join("Cargo.toml")).unwrap(); 143 | 144 | // create a target folder with one simple file in it 145 | std::fs::File::create(target_folder.join("some_artefact")).unwrap(); 146 | 147 | // create also a node case in the root folder 148 | let node_modules_folder = root_folder.path().join("node_modules"); 149 | std::fs::create_dir(&node_modules_folder).unwrap(); 150 | std::fs::File::create(root_folder.path().join("package.json")).unwrap(); 151 | std::fs::File::create(node_modules_folder.join("some_artefact")).unwrap(); 152 | 153 | // now we create a nested node case inside the root folder 154 | let second_node_root_folder = root_folder.path().join("bar"); 155 | std::fs::create_dir(&second_node_root_folder).unwrap(); 156 | let nested_node_modules_folder = second_node_root_folder.join("node_modules"); 157 | std::fs::create_dir(&nested_node_modules_folder).unwrap(); 158 | std::fs::File::create(second_node_root_folder.join("package.json")).unwrap(); 159 | std::fs::File::create(nested_node_modules_folder.join("some_artefact")).unwrap(); 160 | 161 | let args = PutzenCliArgs { 162 | version: false, 163 | dry_run: false, 164 | yes_to_all: true, 165 | follow: false, 166 | dive_into_hidden_folders: false, 167 | folder: root_folder.path().to_path_buf(), 168 | }; 169 | 170 | visit_path(&args).unwrap(); 171 | 172 | assert!(!target_folder.exists()); 173 | assert!(!node_modules_folder.exists()); 174 | assert!(!nested_node_modules_folder.exists()); 175 | 176 | assert!(root_folder.path().join("Cargo.toml").exists()); 177 | assert!(root_folder.path().join("package.json").exists()); 178 | assert!(second_node_root_folder.join("package.json").exists()); 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | mod cleaner; 2 | mod decider; 3 | 4 | pub use crate::cleaner::*; 5 | pub use crate::decider::*; 6 | 7 | use jwalk::{ClientState, DirEntry, Parallelism}; 8 | use std::convert::{TryFrom, TryInto}; 9 | use std::fmt::{Display, Formatter}; 10 | use std::io::{Error, ErrorKind, Result}; 11 | use std::path::{Path, PathBuf}; 12 | use std::time::Duration; 13 | 14 | pub struct FileToFolderMatch { 15 | file_to_check: &'static str, 16 | folder_to_remove: &'static str, 17 | } 18 | 19 | pub enum FolderProcessed { 20 | /// The folder was cleaned and the amount of bytes removed is given 21 | Cleaned(usize), 22 | /// The folder was not cleaned because it did not match any rule 23 | NoRuleMatch, 24 | /// The folder was skipped, e.g. user decided to skip it 25 | Skipped, 26 | /// The folder was aborted, e.g. user decided to abort the whole process 27 | Abort, 28 | } 29 | 30 | impl FileToFolderMatch { 31 | pub const fn new(file_to_check: &'static str, folder_to_remove: &'static str) -> Self { 32 | Self { 33 | file_to_check, 34 | folder_to_remove, 35 | } 36 | } 37 | 38 | /// builds the absolut path, that is to be removed, in the given folder 39 | pub fn path_to_remove(&self, folder: impl AsRef) -> Option> { 40 | folder 41 | .as_ref() 42 | .canonicalize() 43 | .map(|x| x.join(self.folder_to_remove)) 44 | .ok() 45 | } 46 | } 47 | 48 | #[derive(Debug, Eq, PartialEq, Hash)] 49 | pub struct Folder(PathBuf); 50 | 51 | impl Folder { 52 | pub fn accept( 53 | &self, 54 | ctx: &DecisionContext, 55 | rule: &FileToFolderMatch, 56 | cleaner: &dyn DoCleanUp, 57 | decider: &mut impl Decide, 58 | ) -> Result { 59 | // better double check here 60 | if !rule.is_folder_to_remove(self) { 61 | return Ok(FolderProcessed::NoRuleMatch); 62 | } 63 | 64 | let size_amount = self.calculate_size(); 65 | let size = size_amount.as_human_readable(); 66 | let folder = self.as_ref().display().to_string(); 67 | let folder = ctx 68 | .working_dir 69 | .components() 70 | .take(ctx.working_dir.components().count() - 1) 71 | .fold(folder, |acc, component| { 72 | // take only the first letter of each component and add it to the string 73 | if let Some(s) = component.as_os_str().to_str() { 74 | acc.replace(s, s.chars().next().unwrap_or(' ').to_string().as_str()) 75 | } else { 76 | acc 77 | } 78 | }); 79 | 80 | ctx.println(format!("Cleaning {folder} with {size}")); 81 | ctx.println(format!( 82 | " ├─ because of {}", 83 | PathBuf::from("..").join(rule.file_to_check).display() 84 | )); 85 | 86 | let result = match decider.obtain_decision(ctx, "├─ delete directory recursively?") { 87 | Ok(Decision::Yes) => match cleaner.do_cleanup(self.as_ref())? { 88 | Clean::Cleaned => { 89 | ctx.println(format!(" └─ deleted {size}")); 90 | FolderProcessed::Cleaned(size_amount) 91 | } 92 | Clean::NotCleaned => { 93 | ctx.println(format!( 94 | " └─ not deleted{}{size}", 95 | if ctx.is_dry_run { " [dry-run] " } else { "" } 96 | )); 97 | FolderProcessed::Skipped 98 | } 99 | }, 100 | Ok(Decision::Quit) => { 101 | ctx.println(" └─ quiting"); 102 | FolderProcessed::Abort 103 | } 104 | _ => { 105 | ctx.println(" └─ skipped"); 106 | FolderProcessed::Skipped 107 | } 108 | }; 109 | ctx.println(""); 110 | Ok(result) 111 | } 112 | 113 | fn calculate_size(&self) -> usize { 114 | jwalk::WalkDirGeneric::<((), Option)>::new(self.as_ref()) 115 | .skip_hidden(false) 116 | .follow_links(false) 117 | .parallelism(Parallelism::RayonDefaultPool { 118 | busy_timeout: Duration::from_secs(60), 119 | }) 120 | .process_read_dir(|_, _, _, dir_entry_results| { 121 | dir_entry_results.iter_mut().for_each(|dir_entry_result| { 122 | if let Ok(dir_entry) = dir_entry_result { 123 | if !dir_entry.file_type.is_dir() { 124 | dir_entry.client_state = Some( 125 | dir_entry 126 | .metadata() 127 | .map(|m| m.len() as usize) 128 | .unwrap_or_default(), 129 | ); 130 | } 131 | } 132 | }) 133 | }) 134 | .into_iter() 135 | .filter_map(|f| f.ok()) 136 | .filter_map(|e| e.client_state) 137 | .sum() 138 | } 139 | } 140 | 141 | impl Display for Folder { 142 | fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { 143 | write!(f, "{}", self.0.display()) 144 | } 145 | } 146 | 147 | impl TryFrom> for Folder { 148 | type Error = std::io::Error; 149 | 150 | fn try_from(value: DirEntry) -> std::result::Result { 151 | let path = value.path(); 152 | path.try_into() // see below.. 153 | } 154 | } 155 | 156 | impl TryFrom for Folder { 157 | type Error = std::io::Error; 158 | 159 | fn try_from(path: PathBuf) -> std::result::Result { 160 | if !path.is_dir() || path.eq(Path::new(".")) || path.eq(Path::new("..")) { 161 | Err(Error::from(ErrorKind::Unsupported)) 162 | } else { 163 | let p = path.canonicalize()?; 164 | Ok(Self(p)) 165 | } 166 | } 167 | } 168 | 169 | impl TryFrom<&str> for Folder { 170 | type Error = std::io::Error; 171 | 172 | fn try_from(value: &str) -> std::result::Result { 173 | Folder::try_from(PathBuf::from(value)) 174 | } 175 | } 176 | 177 | impl AsRef for Folder { 178 | fn as_ref(&self) -> &Path { 179 | self.0.as_ref() 180 | } 181 | } 182 | 183 | #[deprecated(since = "2.0.0", note = "use trait `IsFolderToRemove` instead")] 184 | pub trait PathToRemoveResolver { 185 | fn resolve_path_to_remove(&self, folder: impl AsRef) -> Result; 186 | } 187 | 188 | #[allow(deprecated)] 189 | impl PathToRemoveResolver for FileToFolderMatch { 190 | fn resolve_path_to_remove(&self, folder: impl AsRef) -> Result { 191 | let folder = folder.as_ref(); 192 | let file_to_check = folder.join(self.file_to_check); 193 | 194 | if file_to_check.exists() { 195 | let path_to_remove = folder.join(self.folder_to_remove); 196 | if path_to_remove.exists() { 197 | return path_to_remove.try_into(); 198 | } 199 | } 200 | 201 | Err(Error::from(ErrorKind::Unsupported)) 202 | } 203 | } 204 | 205 | /// Trait to check if a folder should be removed 206 | /// This is the successor of the deprecated `PathToRemoveResolver` and should be used instead. 207 | /// 208 | /// The trait is implemented for `FileToFolderMatch` and can be used to check if a folder should be removed 209 | /// according to the rules defined in the `FileToFolderMatch` instance. 210 | pub trait IsFolderToRemove { 211 | fn is_folder_to_remove(&self, folder: &Folder) -> bool; 212 | } 213 | 214 | impl IsFolderToRemove for FileToFolderMatch { 215 | fn is_folder_to_remove(&self, folder: &Folder) -> bool { 216 | folder.as_ref().parent().map_or_else( 217 | || false, 218 | |parent| { 219 | parent.join(self.file_to_check).exists() 220 | && parent 221 | .join(self.folder_to_remove) 222 | .starts_with(folder.as_ref()) 223 | }, 224 | ) 225 | } 226 | } 227 | 228 | pub trait HumanReadable { 229 | fn as_human_readable(&self) -> String; 230 | } 231 | 232 | impl HumanReadable for usize { 233 | fn as_human_readable(&self) -> String { 234 | const KIBIBYTE: usize = 1024; 235 | const MEBIBYTE: usize = KIBIBYTE << 10; 236 | const GIBIBYTE: usize = MEBIBYTE << 10; 237 | const TEBIBYTE: usize = GIBIBYTE << 10; 238 | const PEBIBYTE: usize = TEBIBYTE << 10; 239 | const EXBIBYTE: usize = PEBIBYTE << 10; 240 | 241 | let size = *self; 242 | let (size, symbol) = match size { 243 | size if size < KIBIBYTE => (size as f64, "B"), 244 | size if size < MEBIBYTE => (size as f64 / KIBIBYTE as f64, "KiB"), 245 | size if size < GIBIBYTE => (size as f64 / MEBIBYTE as f64, "MiB"), 246 | size if size < TEBIBYTE => (size as f64 / GIBIBYTE as f64, "GiB"), 247 | size if size < PEBIBYTE => (size as f64 / TEBIBYTE as f64, "TiB"), 248 | size if size < EXBIBYTE => (size as f64 / PEBIBYTE as f64, "PiB"), 249 | _ => (size as f64 / EXBIBYTE as f64, "EiB"), 250 | }; 251 | 252 | format!("{size:.1}{symbol}") 253 | } 254 | } 255 | 256 | #[cfg(test)] 257 | mod tests { 258 | use super::*; 259 | 260 | #[test] 261 | fn should_size() { 262 | assert_eq!(1_048_576, 1024 << 10); 263 | } 264 | 265 | #[test] 266 | fn test_trait_is_folder_to_remove() { 267 | let rule = FileToFolderMatch::new("Cargo.toml", "target"); 268 | 269 | let target_folder = 270 | Folder::try_from(Path::new(".").canonicalize().unwrap().join("target")).unwrap(); 271 | assert!(rule.is_folder_to_remove(&target_folder)); 272 | 273 | let crate_root_folder = Folder::try_from(Path::new(".").canonicalize().unwrap()).unwrap(); 274 | assert!(!rule.is_folder_to_remove(&crate_root_folder)); 275 | } 276 | } 277 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "aligned" 7 | version = "0.4.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "377e4c0ba83e4431b10df45c1d4666f178ea9c552cac93e60c3a88bf32785923" 10 | dependencies = [ 11 | "as-slice", 12 | ] 13 | 14 | [[package]] 15 | name = "argh" 16 | version = "0.1.13" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "34ff18325c8a36b82f992e533ece1ec9f9a9db446bd1c14d4f936bac88fcd240" 19 | dependencies = [ 20 | "argh_derive", 21 | "argh_shared", 22 | "rust-fuzzy-search", 23 | ] 24 | 25 | [[package]] 26 | name = "argh_derive" 27 | version = "0.1.13" 28 | source = "registry+https://github.com/rust-lang/crates.io-index" 29 | checksum = "adb7b2b83a50d329d5d8ccc620f5c7064028828538bdf5646acd60dc1f767803" 30 | dependencies = [ 31 | "argh_shared", 32 | "proc-macro2", 33 | "quote", 34 | "syn", 35 | ] 36 | 37 | [[package]] 38 | name = "argh_shared" 39 | version = "0.1.13" 40 | source = "registry+https://github.com/rust-lang/crates.io-index" 41 | checksum = "a464143cc82dedcdc3928737445362466b7674b5db4e2eb8e869846d6d84f4f6" 42 | dependencies = [ 43 | "serde", 44 | ] 45 | 46 | [[package]] 47 | name = "as-slice" 48 | version = "0.2.1" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" 51 | dependencies = [ 52 | "stable_deref_trait", 53 | ] 54 | 55 | [[package]] 56 | name = "bitflags" 57 | version = "2.9.1" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" 60 | 61 | [[package]] 62 | name = "cfg-if" 63 | version = "1.0.1" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" 66 | 67 | [[package]] 68 | name = "cfg_aliases" 69 | version = "0.2.1" 70 | source = "registry+https://github.com/rust-lang/crates.io-index" 71 | checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" 72 | 73 | [[package]] 74 | name = "console" 75 | version = "0.16.0" 76 | source = "registry+https://github.com/rust-lang/crates.io-index" 77 | checksum = "2e09ced7ebbccb63b4c65413d821f2e00ce54c5ca4514ddc6b3c892fdbcbc69d" 78 | dependencies = [ 79 | "encode_unicode", 80 | "libc", 81 | "once_cell", 82 | "unicode-width", 83 | "windows-sys 0.60.2", 84 | ] 85 | 86 | [[package]] 87 | name = "crossbeam" 88 | version = "0.8.4" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" 91 | dependencies = [ 92 | "crossbeam-channel", 93 | "crossbeam-deque", 94 | "crossbeam-epoch", 95 | "crossbeam-queue", 96 | "crossbeam-utils", 97 | ] 98 | 99 | [[package]] 100 | name = "crossbeam-channel" 101 | version = "0.5.15" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" 104 | dependencies = [ 105 | "crossbeam-utils", 106 | ] 107 | 108 | [[package]] 109 | name = "crossbeam-deque" 110 | version = "0.8.6" 111 | source = "registry+https://github.com/rust-lang/crates.io-index" 112 | checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" 113 | dependencies = [ 114 | "crossbeam-epoch", 115 | "crossbeam-utils", 116 | ] 117 | 118 | [[package]] 119 | name = "crossbeam-epoch" 120 | version = "0.9.18" 121 | source = "registry+https://github.com/rust-lang/crates.io-index" 122 | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" 123 | dependencies = [ 124 | "crossbeam-utils", 125 | ] 126 | 127 | [[package]] 128 | name = "crossbeam-queue" 129 | version = "0.3.12" 130 | source = "registry+https://github.com/rust-lang/crates.io-index" 131 | checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" 132 | dependencies = [ 133 | "crossbeam-utils", 134 | ] 135 | 136 | [[package]] 137 | name = "crossbeam-utils" 138 | version = "0.8.21" 139 | source = "registry+https://github.com/rust-lang/crates.io-index" 140 | checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" 141 | 142 | [[package]] 143 | name = "cvt" 144 | version = "0.1.2" 145 | source = "registry+https://github.com/rust-lang/crates.io-index" 146 | checksum = "d2ae9bf77fbf2d39ef573205d554d87e86c12f1994e9ea335b0651b9b278bcf1" 147 | dependencies = [ 148 | "cfg-if", 149 | ] 150 | 151 | [[package]] 152 | name = "dialoguer" 153 | version = "0.12.0" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "25f104b501bf2364e78d0d3974cbc774f738f5865306ed128e1e0d7499c0ad96" 156 | dependencies = [ 157 | "console", 158 | "shell-words", 159 | "tempfile", 160 | "zeroize", 161 | ] 162 | 163 | [[package]] 164 | name = "either" 165 | version = "1.15.0" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" 168 | 169 | [[package]] 170 | name = "encode_unicode" 171 | version = "1.0.0" 172 | source = "registry+https://github.com/rust-lang/crates.io-index" 173 | checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" 174 | 175 | [[package]] 176 | name = "errno" 177 | version = "0.3.13" 178 | source = "registry+https://github.com/rust-lang/crates.io-index" 179 | checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" 180 | dependencies = [ 181 | "libc", 182 | "windows-sys 0.60.2", 183 | ] 184 | 185 | [[package]] 186 | name = "fastrand" 187 | version = "2.3.0" 188 | source = "registry+https://github.com/rust-lang/crates.io-index" 189 | checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" 190 | 191 | [[package]] 192 | name = "fs_at" 193 | version = "0.2.1" 194 | source = "registry+https://github.com/rust-lang/crates.io-index" 195 | checksum = "14af6c9694ea25db25baa2a1788703b9e7c6648dcaeeebeb98f7561b5384c036" 196 | dependencies = [ 197 | "aligned", 198 | "cfg-if", 199 | "cvt", 200 | "libc", 201 | "nix", 202 | "windows-sys 0.52.0", 203 | ] 204 | 205 | [[package]] 206 | name = "getrandom" 207 | version = "0.3.3" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" 210 | dependencies = [ 211 | "cfg-if", 212 | "libc", 213 | "r-efi", 214 | "wasi", 215 | ] 216 | 217 | [[package]] 218 | name = "jwalk" 219 | version = "0.8.1" 220 | source = "registry+https://github.com/rust-lang/crates.io-index" 221 | checksum = "2735847566356cd2179a2a38264839308f7079fa96e6bd5a42d740460e003c56" 222 | dependencies = [ 223 | "crossbeam", 224 | "rayon", 225 | ] 226 | 227 | [[package]] 228 | name = "libc" 229 | version = "0.2.174" 230 | source = "registry+https://github.com/rust-lang/crates.io-index" 231 | checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" 232 | 233 | [[package]] 234 | name = "linux-raw-sys" 235 | version = "0.9.4" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" 238 | 239 | [[package]] 240 | name = "nix" 241 | version = "0.29.0" 242 | source = "registry+https://github.com/rust-lang/crates.io-index" 243 | checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" 244 | dependencies = [ 245 | "bitflags", 246 | "cfg-if", 247 | "cfg_aliases", 248 | "libc", 249 | ] 250 | 251 | [[package]] 252 | name = "normpath" 253 | version = "1.3.0" 254 | source = "registry+https://github.com/rust-lang/crates.io-index" 255 | checksum = "c8911957c4b1549ac0dc74e30db9c8b0e66ddcd6d7acc33098f4c63a64a6d7ed" 256 | dependencies = [ 257 | "windows-sys 0.59.0", 258 | ] 259 | 260 | [[package]] 261 | name = "once_cell" 262 | version = "1.21.3" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" 265 | 266 | [[package]] 267 | name = "proc-macro2" 268 | version = "1.0.95" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" 271 | dependencies = [ 272 | "unicode-ident", 273 | ] 274 | 275 | [[package]] 276 | name = "putzen-cli" 277 | version = "2.0.2" 278 | dependencies = [ 279 | "argh", 280 | "dialoguer", 281 | "jwalk", 282 | "remove_dir_all", 283 | "tempfile", 284 | ] 285 | 286 | [[package]] 287 | name = "quote" 288 | version = "1.0.40" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" 291 | dependencies = [ 292 | "proc-macro2", 293 | ] 294 | 295 | [[package]] 296 | name = "r-efi" 297 | version = "5.3.0" 298 | source = "registry+https://github.com/rust-lang/crates.io-index" 299 | checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" 300 | 301 | [[package]] 302 | name = "rayon" 303 | version = "1.10.0" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" 306 | dependencies = [ 307 | "either", 308 | "rayon-core", 309 | ] 310 | 311 | [[package]] 312 | name = "rayon-core" 313 | version = "1.12.1" 314 | source = "registry+https://github.com/rust-lang/crates.io-index" 315 | checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" 316 | dependencies = [ 317 | "crossbeam-deque", 318 | "crossbeam-utils", 319 | ] 320 | 321 | [[package]] 322 | name = "remove_dir_all" 323 | version = "1.0.0" 324 | source = "registry+https://github.com/rust-lang/crates.io-index" 325 | checksum = "808cc0b475acf76adf36f08ca49429b12aad9f678cb56143d5b3cb49b9a1dd08" 326 | dependencies = [ 327 | "cfg-if", 328 | "cvt", 329 | "fs_at", 330 | "libc", 331 | "normpath", 332 | "windows-sys 0.59.0", 333 | ] 334 | 335 | [[package]] 336 | name = "rust-fuzzy-search" 337 | version = "0.1.1" 338 | source = "registry+https://github.com/rust-lang/crates.io-index" 339 | checksum = "a157657054ffe556d8858504af8a672a054a6e0bd9e8ee531059100c0fa11bb2" 340 | 341 | [[package]] 342 | name = "rustix" 343 | version = "1.0.7" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" 346 | dependencies = [ 347 | "bitflags", 348 | "errno", 349 | "libc", 350 | "linux-raw-sys", 351 | "windows-sys 0.59.0", 352 | ] 353 | 354 | [[package]] 355 | name = "serde" 356 | version = "1.0.219" 357 | source = "registry+https://github.com/rust-lang/crates.io-index" 358 | checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" 359 | dependencies = [ 360 | "serde_derive", 361 | ] 362 | 363 | [[package]] 364 | name = "serde_derive" 365 | version = "1.0.219" 366 | source = "registry+https://github.com/rust-lang/crates.io-index" 367 | checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" 368 | dependencies = [ 369 | "proc-macro2", 370 | "quote", 371 | "syn", 372 | ] 373 | 374 | [[package]] 375 | name = "shell-words" 376 | version = "1.1.0" 377 | source = "registry+https://github.com/rust-lang/crates.io-index" 378 | checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" 379 | 380 | [[package]] 381 | name = "stable_deref_trait" 382 | version = "1.2.0" 383 | source = "registry+https://github.com/rust-lang/crates.io-index" 384 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 385 | 386 | [[package]] 387 | name = "syn" 388 | version = "2.0.104" 389 | source = "registry+https://github.com/rust-lang/crates.io-index" 390 | checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" 391 | dependencies = [ 392 | "proc-macro2", 393 | "quote", 394 | "unicode-ident", 395 | ] 396 | 397 | [[package]] 398 | name = "tempfile" 399 | version = "3.23.0" 400 | source = "registry+https://github.com/rust-lang/crates.io-index" 401 | checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" 402 | dependencies = [ 403 | "fastrand", 404 | "getrandom", 405 | "once_cell", 406 | "rustix", 407 | "windows-sys 0.60.2", 408 | ] 409 | 410 | [[package]] 411 | name = "unicode-ident" 412 | version = "1.0.18" 413 | source = "registry+https://github.com/rust-lang/crates.io-index" 414 | checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" 415 | 416 | [[package]] 417 | name = "unicode-width" 418 | version = "0.2.1" 419 | source = "registry+https://github.com/rust-lang/crates.io-index" 420 | checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" 421 | 422 | [[package]] 423 | name = "wasi" 424 | version = "0.14.2+wasi-0.2.4" 425 | source = "registry+https://github.com/rust-lang/crates.io-index" 426 | checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" 427 | dependencies = [ 428 | "wit-bindgen-rt", 429 | ] 430 | 431 | [[package]] 432 | name = "windows-sys" 433 | version = "0.52.0" 434 | source = "registry+https://github.com/rust-lang/crates.io-index" 435 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 436 | dependencies = [ 437 | "windows-targets 0.52.6", 438 | ] 439 | 440 | [[package]] 441 | name = "windows-sys" 442 | version = "0.59.0" 443 | source = "registry+https://github.com/rust-lang/crates.io-index" 444 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 445 | dependencies = [ 446 | "windows-targets 0.52.6", 447 | ] 448 | 449 | [[package]] 450 | name = "windows-sys" 451 | version = "0.60.2" 452 | source = "registry+https://github.com/rust-lang/crates.io-index" 453 | checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" 454 | dependencies = [ 455 | "windows-targets 0.53.2", 456 | ] 457 | 458 | [[package]] 459 | name = "windows-targets" 460 | version = "0.52.6" 461 | source = "registry+https://github.com/rust-lang/crates.io-index" 462 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 463 | dependencies = [ 464 | "windows_aarch64_gnullvm 0.52.6", 465 | "windows_aarch64_msvc 0.52.6", 466 | "windows_i686_gnu 0.52.6", 467 | "windows_i686_gnullvm 0.52.6", 468 | "windows_i686_msvc 0.52.6", 469 | "windows_x86_64_gnu 0.52.6", 470 | "windows_x86_64_gnullvm 0.52.6", 471 | "windows_x86_64_msvc 0.52.6", 472 | ] 473 | 474 | [[package]] 475 | name = "windows-targets" 476 | version = "0.53.2" 477 | source = "registry+https://github.com/rust-lang/crates.io-index" 478 | checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" 479 | dependencies = [ 480 | "windows_aarch64_gnullvm 0.53.0", 481 | "windows_aarch64_msvc 0.53.0", 482 | "windows_i686_gnu 0.53.0", 483 | "windows_i686_gnullvm 0.53.0", 484 | "windows_i686_msvc 0.53.0", 485 | "windows_x86_64_gnu 0.53.0", 486 | "windows_x86_64_gnullvm 0.53.0", 487 | "windows_x86_64_msvc 0.53.0", 488 | ] 489 | 490 | [[package]] 491 | name = "windows_aarch64_gnullvm" 492 | version = "0.52.6" 493 | source = "registry+https://github.com/rust-lang/crates.io-index" 494 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 495 | 496 | [[package]] 497 | name = "windows_aarch64_gnullvm" 498 | version = "0.53.0" 499 | source = "registry+https://github.com/rust-lang/crates.io-index" 500 | checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" 501 | 502 | [[package]] 503 | name = "windows_aarch64_msvc" 504 | version = "0.52.6" 505 | source = "registry+https://github.com/rust-lang/crates.io-index" 506 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 507 | 508 | [[package]] 509 | name = "windows_aarch64_msvc" 510 | version = "0.53.0" 511 | source = "registry+https://github.com/rust-lang/crates.io-index" 512 | checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" 513 | 514 | [[package]] 515 | name = "windows_i686_gnu" 516 | version = "0.52.6" 517 | source = "registry+https://github.com/rust-lang/crates.io-index" 518 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 519 | 520 | [[package]] 521 | name = "windows_i686_gnu" 522 | version = "0.53.0" 523 | source = "registry+https://github.com/rust-lang/crates.io-index" 524 | checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" 525 | 526 | [[package]] 527 | name = "windows_i686_gnullvm" 528 | version = "0.52.6" 529 | source = "registry+https://github.com/rust-lang/crates.io-index" 530 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 531 | 532 | [[package]] 533 | name = "windows_i686_gnullvm" 534 | version = "0.53.0" 535 | source = "registry+https://github.com/rust-lang/crates.io-index" 536 | checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" 537 | 538 | [[package]] 539 | name = "windows_i686_msvc" 540 | version = "0.52.6" 541 | source = "registry+https://github.com/rust-lang/crates.io-index" 542 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 543 | 544 | [[package]] 545 | name = "windows_i686_msvc" 546 | version = "0.53.0" 547 | source = "registry+https://github.com/rust-lang/crates.io-index" 548 | checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" 549 | 550 | [[package]] 551 | name = "windows_x86_64_gnu" 552 | version = "0.52.6" 553 | source = "registry+https://github.com/rust-lang/crates.io-index" 554 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 555 | 556 | [[package]] 557 | name = "windows_x86_64_gnu" 558 | version = "0.53.0" 559 | source = "registry+https://github.com/rust-lang/crates.io-index" 560 | checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" 561 | 562 | [[package]] 563 | name = "windows_x86_64_gnullvm" 564 | version = "0.52.6" 565 | source = "registry+https://github.com/rust-lang/crates.io-index" 566 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 567 | 568 | [[package]] 569 | name = "windows_x86_64_gnullvm" 570 | version = "0.53.0" 571 | source = "registry+https://github.com/rust-lang/crates.io-index" 572 | checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" 573 | 574 | [[package]] 575 | name = "windows_x86_64_msvc" 576 | version = "0.52.6" 577 | source = "registry+https://github.com/rust-lang/crates.io-index" 578 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 579 | 580 | [[package]] 581 | name = "windows_x86_64_msvc" 582 | version = "0.53.0" 583 | source = "registry+https://github.com/rust-lang/crates.io-index" 584 | checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" 585 | 586 | [[package]] 587 | name = "wit-bindgen-rt" 588 | version = "0.39.0" 589 | source = "registry+https://github.com/rust-lang/crates.io-index" 590 | checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" 591 | dependencies = [ 592 | "bitflags", 593 | ] 594 | 595 | [[package]] 596 | name = "zeroize" 597 | version = "1.8.1" 598 | source = "registry+https://github.com/rust-lang/crates.io-index" 599 | checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" 600 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or OPTIONS, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------