drt-tools-0.2.20/.cargo_vcs_info.json0000644000000001360000000000100130440ustar { "git": { "sha1": "637bbff6611f7c590d16214c908c7484f55bcac1" }, "path_in_vcs": "" }drt-tools-0.2.20/.github/FUNDING.yml000064400000000000000000000000251046102023000150060ustar 00000000000000github: [sebastinas] drt-tools-0.2.20/.github/dependabot.yml000064400000000000000000000004241046102023000160240ustar 00000000000000version: 2 updates: - package-ecosystem: "cargo" directory: "/" schedule: interval: "weekly" ignore: - dependency-name: "*" update-types: ["version-update:semver-patch"] - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" drt-tools-0.2.20/.github/workflows/build.yaml000064400000000000000000000033421046102023000172160ustar 00000000000000name: Rust on: [push, pull_request] env: CARGO_TERM_COLOR: always jobs: test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: toolchain: - "1.70" - stable name: Test with ${{matrix.toolchain}} toolchain steps: - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update sudo apt-get install pkg-config - uses: dtolnay/rust-toolchain@master with: toolchain: ${{matrix.toolchain}} - uses: Swatinem/rust-cache@v2 - name: Install dependencies compatible with MSRV run: | cargo update -p clap --precise 4.4.18 cargo update -p clap-verbosity-flag --precise 2.1.2 if: ${{matrix.toolchain != 'stable'}} - name: Test with default features run: cargo test --workspace - name: Test with all features run: cargo test --all-features --workspace fmt: name: Rustfmt runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update sudo apt-get install pkg-config - uses: dtolnay/rust-toolchain@stable with: components: rustfmt - uses: Swatinem/rust-cache@v2 - run: cargo fmt --all -- --check clippy: name: Clippy runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update sudo apt-get install pkg-config - uses: dtolnay/rust-toolchain@stable with: components: clippy - uses: Swatinem/rust-cache@v2 - run: cargo clippy --all --all-features -- -D warnings drt-tools-0.2.20/.gitignore000064400000000000000000000000311046102023000136160ustar 00000000000000.idea /target Cargo.lock drt-tools-0.2.20/CHANGELOG.md000064400000000000000000000051471046102023000134540ustar 00000000000000# Changelog ## 0.2.20 (2024-02-17) * Handle more releases. * `nmu-eso`: Add support for `Static-Built-Using`. ## 0.2.19 (2024-02-02) * Parse `Release` files to determine list of architectures. * Remove use of `regex` crate. * Handle HTTP errors proberly. ## 0.2.18 (2023-11-21) * Some internal refactoring * Bump `itertools` to 0.12. ## 0.2.17 (2023-09-14) * Implement new sub-command: * `nmu-version-skew`: binNMU MA: same packages which out-of-sync versions * Bump MSRV to 1.70 due to dependencies ## 0.2.16 (2023-06-11) * Fix handling of `verbose` and `quiet` flags. ## 0.2.15 (2023-06-10) * Upgrade `assorted-debian-utils` to 0.6. * Bump MSRV to 1.65 ## 0.2.14 (2023-04-15) * Bump MSRV to 1.64 * `usrmerged`: Find more moved files. ## 0.2.13 (2023-03-16) * `nmu-eso`: Take `Package` and `Source` files from the archive to build list of packages needing a rebuild. * `nmu-eso`: Only skip `debian-installer` and `-signed` packages. ## 0.2.12 (2023-02-25) * `nmu-eso`: Skip `-signed` packages. * `nmu-eso`: Mention cause for rebuilds in binNMU message. * Refactor command implementaton. ## 0.2.11 (2023-01-17) * Implement new sub-command: * `process-unblocks`: Produce a list of packages that require unblocks. ## 0.2.10 (2022-10-30) * Download compressed migration excuses. ## 0.2.9 (2022-10-02) * `binNMU-buildinfo`: Various improvements. * Upgrade to `clap` 4. ## 0.2.8 (2022-09-18) * `binNMU-buildinfo`: Make command usable again. ## 0.2.7 (2022-09-09) * Reduce feature flags of dependencies. * Make mirror for package files configurable. * `nmu-eso`: Reduce options and provide sensible defaults. ## 0.2.6 (2022-07-09) * Implement new sub-command: * `usrmerged`: check file moves between /usr and / * Implement parallel downloads ## 0.2.5 (2022-05-22) * `nmu-eso`: Skip packages that FTBFS. ## 0.2.4 (2022-04-25) * Implement new sub-command: * grep-excuses: Similar to `grep-excuses(1)`. * `nmu-eso`: Rebuild packages with outdated Built-Using. * `prepare-binNMUs`: Skip packages with FTBFS bugs. ## 0.2.3 (2022-04-06) * Update to assorted-debian-utils 0.4.0. * `process-excuses`: Correctly skip packages that would require a binNMU for arch: all. ## 0.2.2 (2022-01-30) * Implement new sub-command: * binnmu-buildinfo: Based on a list of buildinfo files, schedule binNMUs. * Migrate from `structopt` to `clap` 3. ## 0.2.1 (2021-12-22) * Bump to rfc822-like 0.2.1 and deserialize `Multi-Arch` as enum. ## 0.2 (2021-12-12) * Implement sub-commands: * process-excuses: Covers the old functionality * prepare-binNMUs: Generate a list of binNMUs for a transition ## 0.1 (2021-11-17) * Initial release. drt-tools-0.2.20/Cargo.lock0000644000001325210000000000100110230ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "addr2line" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] [[package]] name = "adler" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] name = "android-tzdata" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" [[package]] name = "android_system_properties" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" dependencies = [ "libc", ] [[package]] name = "anstream" version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", "utf8parse", ] [[package]] name = "anstyle" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", "windows-sys 0.52.0", ] [[package]] name = "anyhow" version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "assorted-debian-utils" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10e8a46718e5f9bc15cbe8897744d2199538088fe99a6a8f4085b61ada92ba18" dependencies = [ "chrono", "hex", "rfc822-like", "serde", "serde_yaml", "smallvec", "thiserror", ] [[package]] name = "async-trait" version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", ] [[package]] name = "base64" version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bumpalo" version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d32a994c2b3ca201d9b263612a374263f05e7adde37c4707f693dcd375076d1f" [[package]] name = "bytes" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cc" version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "libc", ] [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", "wasm-bindgen", "windows-targets 0.52.0", ] [[package]] name = "clap" version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" dependencies = [ "clap_builder", "clap_derive", ] [[package]] name = "clap-verbosity-flag" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb9b20c0dd58e4c2e991c8d203bbeb76c11304d1011659686b5b644bc29aa478" dependencies = [ "clap", "log", ] [[package]] name = "clap_builder" version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" dependencies = [ "anstream", "anstyle", "clap_lex", "strsim", "terminal_size", "unicase", "unicode-width", ] [[package]] name = "clap_derive" version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", "proc-macro2", "quote", "syn", ] [[package]] name = "clap_lex" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "console" version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", "windows-sys 0.52.0", ] [[package]] name = "core-foundation" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "core-foundation-sys" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "crc32fast" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", ] [[package]] name = "drt-tools" version = "0.2.20" dependencies = [ "anyhow", "assorted-debian-utils", "async-trait", "chrono", "clap", "clap-verbosity-flag", "flate2", "futures-util", "httpdate", "indicatif", "itertools", "log", "reqwest", "serde", "serde_yaml", "smallvec", "smartstring", "stderrlog", "thiserror", "tokio", "voca_rs", "xdg", "xz2", ] [[package]] name = "either" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "encode_unicode" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", "windows-sys 0.52.0", ] [[package]] name = "fastrand" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "flate2" version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "libz-sys", "miniz_oxide", ] [[package]] name = "fmt2io" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9404d2b1fefa46590726ba6c729bfb18ac6e2a2efdfb094aeb53df1c0436376f" [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foreign-types" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ "foreign-types-shared", ] [[package]] name = "foreign-types-shared" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "futures-channel" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", ] [[package]] name = "futures-core" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-io" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "futures-sink" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-core", "futures-io", "futures-macro", "futures-sink", "futures-task", "memchr", "pin-project-lite", "pin-utils", "slab", ] [[package]] name = "gimli" version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "h2" version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", "futures-core", "futures-sink", "futures-util", "http", "indexmap", "slab", "tokio", "tokio-util", "tracing", ] [[package]] name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" [[package]] name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "http" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", "itoa", ] [[package]] name = "http-body" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", "pin-project-lite", ] [[package]] name = "httparse" version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", "h2", "http", "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", "socket2", "tokio", "tower-service", "tracing", "want", ] [[package]] name = "hyper-tls" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", "hyper", "native-tls", "tokio", "tokio-native-tls", ] [[package]] name = "iana-time-zone" version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", "windows-core", ] [[package]] name = "iana-time-zone-haiku" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ "cc", ] [[package]] name = "idna" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", "hashbrown", ] [[package]] name = "indicatif" version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" dependencies = [ "console", "instant", "number_prefix", "portable-atomic", "unicode-width", ] [[package]] name = "instant" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", ] [[package]] name = "ipnet" version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", "libc", "windows-sys 0.52.0", ] [[package]] name = "itertools" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] [[package]] name = "itoa" version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libz-sys" version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6" dependencies = [ "cc", "pkg-config", "vcpkg", ] [[package]] name = "linux-raw-sys" version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "log" version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lzma-sys" version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" dependencies = [ "cc", "libc", "pkg-config", ] [[package]] name = "memchr" version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "mime" version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] [[package]] name = "mio" version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi", "windows-sys 0.48.0", ] [[package]] name = "native-tls" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" dependencies = [ "lazy_static", "libc", "log", "openssl", "openssl-probe", "openssl-sys", "schannel", "security-framework", "security-framework-sys", "tempfile", ] [[package]] name = "num-traits" version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ "hermit-abi", "libc", ] [[package]] name = "number_prefix" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" version = "0.10.63" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ "bitflags 2.4.2", "cfg-if", "foreign-types", "libc", "once_cell", "openssl-macros", "openssl-sys", ] [[package]] name = "openssl-macros" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ "cc", "libc", "pkg-config", "vcpkg", ] [[package]] name = "percent-encoding" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "portable-atomic" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] name = "proc-macro2" version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "quote" version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] [[package]] name = "regex" version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", "regex-automata", "regex-syntax", ] [[package]] name = "regex-automata" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ "base64", "bytes", "encoding_rs", "futures-core", "futures-util", "h2", "http", "http-body", "hyper", "hyper-tls", "ipnet", "js-sys", "log", "mime", "native-tls", "once_cell", "percent-encoding", "pin-project-lite", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", "tokio-util", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", "web-sys", "winreg", ] [[package]] name = "rfc822-like" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2573545992daa7840cbed3e22e0abf0ac2c4c8692ba1a7f58e435c110769dc88" dependencies = [ "fmt2io", "serde", "thiserror", "unicode-segmentation", ] [[package]] name = "rustc-demangle" version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", "windows-sys 0.52.0", ] [[package]] name = "rustls-pemfile" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ "base64", ] [[package]] name = "ryu" version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "schannel" version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "security-framework" version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", "security-framework-sys", ] [[package]] name = "security-framework-sys" version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "serde" version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "serde_json" version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", "serde", ] [[package]] name = "serde_urlencoded" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", "itoa", "ryu", "serde", ] [[package]] name = "serde_yaml" version = "0.9.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adf8a49373e98a4c5f0ceb5d05aa7c648d75f63774981ed95b7c7443bbd50c6e" dependencies = [ "indexmap", "itoa", "ryu", "serde", "unsafe-libyaml", ] [[package]] name = "slab" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" dependencies = [ "serde", ] [[package]] name = "smartstring" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" dependencies = [ "autocfg", "static_assertions", "version_check", ] [[package]] name = "socket2" version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys 0.48.0", ] [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stderrlog" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c910772f992ab17d32d6760e167d2353f4130ed50e796752689556af07dc6b" dependencies = [ "chrono", "is-terminal", "log", "termcolor", "thread_local", ] [[package]] name = "stfu8" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51f1e89f093f99e7432c491c382b88a6860a5adbe6bf02574bf0a08efff1978" [[package]] name = "strsim" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "syn" version = "2.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "sync_wrapper" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "system-configuration" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "tempfile" version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", "fastrand", "rustix", "windows-sys 0.52.0", ] [[package]] name = "termcolor" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ "winapi-util", ] [[package]] name = "terminal_size" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ "rustix", "windows-sys 0.48.0", ] [[package]] name = "thiserror" version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "thread_local" version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ "cfg-if", "once_cell", ] [[package]] name = "tinyvec" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", "libc", "mio", "num_cpus", "pin-project-lite", "socket2", "tokio-macros", "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "tokio-native-tls" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", "tokio", ] [[package]] name = "tokio-util" version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", "tracing", ] [[package]] name = "tower-service" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] [[package]] name = "try-lock" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "unicase" version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ "version_check", ] [[package]] name = "unicode-bidi" version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unsafe-libyaml" version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" [[package]] name = "url" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] [[package]] name = "utf8parse" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "vcpkg" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "voca_rs" version = "1.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e44efbf25e32768d5ecd22244feacc3d3b3eca72d318f5ef0a4764c2c158e18" dependencies = [ "regex", "stfu8", "unicode-segmentation", ] [[package]] name = "want" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ "try-lock", ] [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ "cfg-if", "js-sys", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "wasm-streams" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" dependencies = [ "futures-util", "js-sys", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", ] [[package]] name = "web-sys" version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] name = "winapi" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ "winapi-i686-pc-windows-gnu", "winapi-x86_64-pc-windows-gnu", ] [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ "windows-targets 0.52.0", ] [[package]] name = "windows-sys" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ "windows-targets 0.48.5", ] [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets 0.52.0", ] [[package]] name = "windows-targets" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm 0.48.5", "windows_aarch64_msvc 0.48.5", "windows_i686_gnu 0.48.5", "windows_i686_msvc 0.48.5", "windows_x86_64_gnu 0.48.5", "windows_x86_64_gnullvm 0.48.5", "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ "windows_aarch64_gnullvm 0.52.0", "windows_aarch64_msvc 0.52.0", "windows_i686_gnu 0.52.0", "windows_i686_msvc 0.52.0", "windows_x86_64_gnu 0.52.0", "windows_x86_64_gnullvm 0.52.0", "windows_x86_64_msvc 0.52.0", ] [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winreg" version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ "cfg-if", "windows-sys 0.48.0", ] [[package]] name = "xdg" version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213b7324336b53d2414b2db8537e56544d981803139155afa84f76eeebb7a546" [[package]] name = "xz2" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" dependencies = [ "lzma-sys", ] drt-tools-0.2.20/Cargo.toml0000644000000041060000000000100110430ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.70" name = "drt-tools" version = "0.2.20" authors = ["Sebastian Ramacher "] description = "Tools for Debian Release Team work" readme = "README.md" keywords = ["debian"] license = "GPL-3.0-or-later" repository = "https://github.com/sebastinas/drt-tools" [dependencies.anyhow] version = "1" [dependencies.assorted-debian-utils] version = "0.7" [dependencies.async-trait] version = "0.1" default-features = false [dependencies.chrono] version = "0.4" default-features = false [dependencies.clap] version = "4" features = [ "derive", "unicode", "wrap_help", ] [dependencies.clap-verbosity-flag] version = "2" [dependencies.flate2] version = "1" features = ["zlib"] default-features = false [dependencies.futures-util] version = "0.3" features = ["std"] default-features = false [dependencies.httpdate] version = "1" [dependencies.indicatif] version = "0.17" [dependencies.itertools] version = "0.12" [dependencies.log] version = "0.4" [dependencies.reqwest] version = "0.11" features = ["stream"] [dependencies.serde] version = "1" features = ["derive"] [dependencies.serde_yaml] version = "0.9" [dependencies.smallvec] version = "1" features = ["union"] default-features = false [dependencies.smartstring] version = "1" [dependencies.stderrlog] version = "0.6" [dependencies.thiserror] version = "1" [dependencies.tokio] version = "1.13" features = [ "macros", "rt-multi-thread", ] default-features = false [dependencies.voca_rs] version = "1.14" [dependencies.xdg] version = "2.4" [dependencies.xz2] version = "0.1" default-features = false drt-tools-0.2.20/Cargo.toml.orig000064400000000000000000000025231046102023000145250ustar 00000000000000[package] name = "drt-tools" description = "Tools for Debian Release Team work" version = "0.2.20" authors = ["Sebastian Ramacher "] repository = "https://github.com/sebastinas/drt-tools" license = "GPL-3.0-or-later" edition = "2021" rust-version = "1.70" readme = "README.md" keywords = ["debian"] [workspace] members = ["assorted-debian-utils"] [dependencies] anyhow = "1" assorted-debian-utils = { version = "0.7", path = "assorted-debian-utils" } async-trait = { version = "0.1", default-features = false } chrono = { version = "0.4", default-features = false } clap = { version = "4", features = ["derive", "unicode", "wrap_help"] } clap-verbosity-flag = "2" flate2 = { version = "1", default-features = false, features = ["zlib"] } futures-util = { version = "0.3", default-features = false, features = ["std"] } httpdate = "1" indicatif = "0.17" itertools = "0.12" log = "0.4" reqwest = { version = "0.11", features = ["stream"] } serde = { version = "1", features = ["derive"] } serde_yaml = "0.9" smartstring = "1" smallvec = { version = "1", default-features = false, features = ["union"] } stderrlog = "0.6" thiserror = { version = "1" } tokio = { version = "1.13", default-features = false, features = [ "macros", "rt-multi-thread", ] } voca_rs = "1.14" xdg = "2.4" xz2 = { version = "0.1", default-features = false } drt-tools-0.2.20/LICENSE000064400000000000000000001045151046102023000126470ustar 00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . drt-tools-0.2.20/README.md000064400000000000000000000036211046102023000131150ustar 00000000000000# Tools for Debian Release Team work This crate includes tools to help with typical work of Debian's release team. Currently, it processes `excuses.yaml` to check for packages that require a binNMU for migration to testing, prepares a list of binNMUs for transitions, and so on. ## Usage: `drt-tools` supports common options: * `-n`: Generate a list of `wb` commands, but do not schedule them. * `-f,--force`: Force processing even if some conditions are not met. The following commands are provided: * `grep-excuses`: Mostly the same as the tool of the same name from `devscripts`. * `process-excuses`: Download and process `excuses.yaml` to generate a list binNMUs for packages that require them for migration. Packages that have other issues preventing them from migrating, are not considered. * `process-unblocks`: Download and process `excuses.yaml` to generate a list of unblocks for packages in tpu and some other cases. * `nmu-transition`: Take a list packages copies from [ben's output](https://release.debian.org/transitions) and schedules binNMUs. This command supports multiple options: * `-m message`: the binNMU message * `--dw dependency`: additionally generate a `dw` command with the given dependency * `--extra-depends dependency`: schedule the binNMUs with an extra dependency * `--bp priority`: specify a build priority * `--suite suite`: specify a suite * `-a architecture`: use a different architecture than `ANY` * `nmu-eso`: Produce and schedule a list of rebuilds for packages having Built-Using on source packages with `Extra-Source-Only: yes` set. This command supports the following options: * `--bp priority`: specifiy a build priority (default: -50) * `--suite suite`: specify a suite * `usrmerged`: Check for packages moving files from / to /usr or vice versa. ## License This crate is Copyright 2021-2024 Sebastian Ramacher and licensed under the GPL version 3.0 or later. drt-tools-0.2.20/src/binnmu_buildinfo.rs000064400000000000000000000212541046102023000163200ustar 00000000000000// Copyright 2022-2023 Sebastian Ramacher // SPDX-License-Identifier: GPL-3.0-or-later use std::collections::HashMap; use std::io::{BufRead, BufReader, Write}; use std::path::{Path, PathBuf}; use std::{collections::HashSet, fs::File}; use anyhow::{anyhow, Result}; use assorted_debian_utils::archive::{Codename, Suite}; use assorted_debian_utils::rfc822_like; use assorted_debian_utils::version::PackageVersion; use assorted_debian_utils::{ architectures::Architecture, buildinfo::{self, Buildinfo}, wb::{BinNMU, SourceSpecifier, WBCommand, WBCommandBuilder}, }; use async_trait::async_trait; use clap::Parser; use indicatif::{ProgressBar, ProgressIterator}; use serde::Deserialize; use crate::config::{default_progress_style, default_progress_template}; use crate::udd_bugs::{load_bugs_from_reader, UDDBugs}; use crate::Command; use crate::{ config::{Cache, CacheEntries}, source_packages::SourcePackages, BaseOptions, BinNMUsOptions, }; #[derive(Deserialize, Debug, Eq, PartialEq)] #[serde(rename_all = "PascalCase")] struct BinaryPackage { source: Option, package: String, version: PackageVersion, } #[derive(Debug, Parser)] pub(crate) struct BinNMUBuildinfoOptions { #[clap(flatten)] binnmu_options: BinNMUsOptions, /// Input files inputs: Vec, } pub(crate) struct BinNMUBuildinfo<'a> { cache: &'a Cache, base_options: &'a BaseOptions, options: BinNMUBuildinfoOptions, } impl<'a> BinNMUBuildinfo<'a> { pub(crate) fn new( cache: &'a Cache, base_options: &'a BaseOptions, options: BinNMUBuildinfoOptions, ) -> Self { Self { cache, base_options, options, } } fn parse_packages(path: impl AsRef) -> Result> { // read Package file let binary_packages: Vec = rfc822_like::from_file(path.as_ref())?; let pb = ProgressBar::new(binary_packages.len() as u64); pb.set_style(default_progress_style().template(default_progress_template())?); pb.set_message(format!("Processing {}", path.as_ref().display())); Ok(binary_packages .into_iter() .progress_with(pb) .map(|binary_package| { if let Some(source_package) = &binary_package.source { ( source_package.split_whitespace().next().unwrap().into(), binary_package.version, ) } else { // no Source set, so Source == Package (binary_package.package, binary_package.version) } }) .collect()) } fn process( &self, buildinfo: Buildinfo, source_packages: &SourcePackages, source_versions: &HashMap, ftbfs_bugs: &UDDBugs, ) -> Result { let mut source_split = buildinfo.source.split_whitespace(); let source_package = source_split.next().unwrap(); let architectures: Vec = buildinfo .architecture .into_iter() .filter(|arch| *arch != Architecture::All && *arch != Architecture::Source) .collect(); if architectures.is_empty() { return Err(anyhow!("no binNMU-able architecture")); } match source_versions.get(source_package) { Some(version) => { if version > &buildinfo.version { return Err(anyhow!("newer version in archive")); } } None => return Err(anyhow!("removed from the archive")), } if ftbfs_bugs.bugs_for_source(source_package).is_some() { return Err(anyhow!("skipping due to FTBFS bugs")); } let mut source = SourceSpecifier::new(source_package); let version = buildinfo.version.without_binnmu_version(); source .with_version(&version) .with_suite(self.options.binnmu_options.suite); if !source_packages.is_ma_same(source_package) { // binNMU only on the architecture if no MA: same binary packages source.with_archive_architectures(&architectures); } let mut binnmu = BinNMU::new(&source, &self.options.binnmu_options.message)?; if let Some(bp) = self.options.binnmu_options.build_priority { binnmu.with_build_priority(bp); } if let Some(dw) = &self.options.binnmu_options.dep_wait { binnmu.with_dependency_wait(dw); } if let Some(extra_depends) = &self.options.binnmu_options.extra_depends { binnmu.with_extra_depends(extra_depends); } Ok(binnmu.build()) } fn process_path( &self, path: impl AsRef, source_packages: &SourcePackages, source_versions: &HashMap, ftbfs_bugs: &UDDBugs, ) -> Result> { let mut ret = HashSet::new(); let path = path.as_ref(); if path.is_dir() { for path in path.read_dir()? { ret.extend( self.process_path(path?.path(), source_packages, source_versions, ftbfs_bugs) .unwrap_or_default(), ); } } else { let data = strip_signature(BufReader::new(File::open(path)?))?; match buildinfo::from_reader(data.as_ref()) { Err(e) => { println!("# skipping {}: {}", path.display(), e); } Ok(bi) => match self.process(bi, source_packages, source_versions, ftbfs_bugs) { Err(e) => { println!("# skipping {}: {}", path.display(), e,); } Ok(command) => { ret.insert(command); } }, } } Ok(ret) } fn load_bugs(&self) -> Result { load_bugs_from_reader(self.cache.get_cache_bufreader(format!( "udd-ftbfs-bugs-{}.yaml", Codename::from(self.options.binnmu_options.suite) ))?) } } #[async_trait] impl Command for BinNMUBuildinfo<'_> { async fn run(&self) -> Result<()> { // store latest version of all source packages let mut source_versions: HashMap = HashMap::new(); for path in self.cache.get_package_paths(Suite::Unstable, true)? { for (source, version) in Self::parse_packages(path)?.into_iter() { match source_versions.get_mut(&source) { Some(old_ver) => { if version > *old_ver { *old_ver = version; } } None => { source_versions.insert(source, version); } } } } let source_packages = SourcePackages::new(&self.cache.get_package_paths(Suite::Unstable, false)?)?; let ftbfs_bugs = if !self.base_options.force_processing { self.load_bugs()? } else { UDDBugs::new(vec![]) }; let mut wb_commands = HashSet::new(); // iterate over all buildinfo files for filename in &self.options.inputs { wb_commands.extend( self.process_path(filename, &source_packages, &source_versions, &ftbfs_bugs) .unwrap_or_default(), ); } for commands in wb_commands { println!("{}", commands); if !self.base_options.dry_run { commands.execute()?; } } Ok(()) } fn downloads(&self) -> Vec { [ CacheEntries::Packages(self.options.binnmu_options.suite.into()), CacheEntries::FTBFSBugs(self.options.binnmu_options.suite.into()), ] .into() } } // Strip the signature from a buildinfo file without verifying it fn strip_signature(input: impl BufRead) -> Result> { let mut data = vec![]; for line in input.lines().skip_while(|rline| { // Skip until the beginning of a buildinfo file rline .as_ref() .map(|line| !line.starts_with("Format: ")) .unwrap_or(true) }) { let Ok(line) = line else { break; }; // Read until beginning of the signature block if line.starts_with("-----BEGIN") { return Ok(data); } data.write_all(line.as_bytes())?; data.write_all(b"\n")?; } Ok(data) } drt-tools-0.2.20/src/config.rs000064400000000000000000000441741046102023000142500ustar 00000000000000// Copyright 2021-2024 Sebastian Ramacher // SPDX-License-Identifier: GPL-3.0-or-later use std::{ borrow::Cow, fs::{self, File}, io::{BufReader, BufWriter, Write}, path::{Path, PathBuf}, }; use anyhow::{Context, Result}; use assorted_debian_utils::{ architectures::Architecture, archive::{Codename, Extension, Suite}, release, }; use flate2::write::GzDecoder; use futures_util::StreamExt; use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; use log::{debug, trace}; use reqwest::{header, Client, Response, StatusCode}; use xdg::BaseDirectories; use xz2::write::XzDecoder; pub(crate) fn default_progress_style() -> ProgressStyle { ProgressStyle::default_bar().progress_chars("â–ˆ ") } pub(crate) fn default_progress_template() -> &'static str { "{msg}: {spinner:.green} [{wide_bar:.cyan/blue}] {pos}/{len} ({per_sec}, {eta})" } #[derive(Debug, Clone, Copy)] pub(crate) enum CacheEntries { Excuses, Packages(Suite), Sources(Suite), FTBFSBugs(Codename), AutoRemovals, Contents(Suite), Release(Suite), } #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub(crate) enum CacheState { NoUpdate, FreshFiles, } #[derive(Debug, Clone, Copy, Eq, PartialEq)] enum Compressor { Xz, Gz, None, } #[derive(Debug, Clone)] struct Downloader { always_download: bool, client: Client, } impl Downloader { pub fn new(always_download: bool) -> Self { Self { always_download, client: Client::new(), } } async fn download_init( &self, url: &str, path: &Path, mp: MultiProgress, ) -> Result> { debug!("Starting download of {} to {:?}", url, path); let res = self.client.get(url); let res = if !self.always_download { if let Ok(dst_metadata) = fs::metadata(path) { // if always_download was not set and we have local copy, tell the server the date res.header( header::IF_MODIFIED_SINCE, httpdate::fmt_http_date(dst_metadata.modified()?), ) } else { res } } else { res } .send() .await .and_then(|response| response.error_for_status()) .with_context(|| format!("Failed to GET from '{}'", &url))?; if !self.always_download && res.status() == StatusCode::NOT_MODIFIED { // this will only trigger if always_download is not set and the server reports that the // file was not modified debug!( "Skipping {}: always_download is not set and the file was not modified", url ); return Ok(None); } if let Some(total_size) = res.content_length() { let pb = mp.add(ProgressBar::new(total_size)); pb.set_style(default_progress_style().template( "{msg}: {spinner:.green} [{elapsed_precise}] [{wide_bar:.cyan/blue}] {bytes}/{total_bytes} ({bytes_per_sec}, {eta})")?); pb.set_message(format!("Downloading {}", url)); Ok(Some((res, pb))) } else { let pb = mp.add(ProgressBar::new_spinner()); pb.set_message(format!("Downloading {}", url)); Ok(Some((res, pb))) } } async fn download_internal( &self, res: Response, pb: &ProgressBar, writer: &mut impl Write, ) -> Result<()> { let mut stream = res.bytes_stream(); while let Some(item) = stream.next().await { let chunk = item.with_context(|| "Error while downloading file")?; writer .write_all(&chunk) .with_context(|| "Error while writing to file")?; pb.inc(chunk.len() as u64); } Ok(()) } pub async fn download_file

( &self, url: &str, path: P, compressor: Compressor, mp: MultiProgress, ) -> Result where P: AsRef, { self._download_file(url, path.as_ref(), compressor, mp) .await } async fn _download_file( &self, url: &str, path: &Path, compressor: Compressor, mp: MultiProgress, ) -> Result { let Some((res, pb)) = self.download_init(url, path, mp).await? else { return Ok(CacheState::NoUpdate); }; let tmp_file = path.with_file_name({ let mut tmp = path.file_name().unwrap().to_owned(); tmp.push(".tmp"); tmp }); let mut file = File::create(&tmp_file) .with_context(|| format!("Failed to create temporary file '{:?}'", tmp_file))?; if compressor == Compressor::Xz { self.download_internal(res, &pb, &mut XzDecoder::new(file)) .await?; } else if compressor == Compressor::Gz { let mut writer = GzDecoder::new(file); self.download_internal(res, &pb, &mut writer).await?; writer.try_finish()?; } else { self.download_internal(res, &pb, &mut file).await?; } pb.finish_with_message(format!("Downloaded {}", url)); fs::rename(&tmp_file, path).with_context(|| { format!( "Failed to move temporary file '{:?}' to '{:?}'", tmp_file, path ) })?; debug!("Download of {} to {:?} done", url, path); Ok(CacheState::FreshFiles) } } fn excuses_urls() -> Vec<(Cow<'static, str>, Compressor, Cow<'static, str>)> { vec![( "https://release.debian.org/britney/excuses.yaml.gz".into(), Compressor::Gz, "excuses.yaml".into(), )] } fn ftbfs_bugs_urls(codename: Codename) -> Vec<(Cow<'static, str>, Compressor, Cow<'static, str>)> { vec![( format!("https://udd.debian.org/bugs/?release={}&ftbfs=only&merged=ign&done=ign&rc=1&sortby=id&sorto=asc&format=yaml", codename).into(), Compressor::None, format!("udd-ftbfs-bugs-{}.yaml", codename).into() )] } fn auto_removals_urls() -> Vec<(Cow<'static, str>, Compressor, Cow<'static, str>)> { vec![( "https://udd.debian.org/cgi-bin/autoremovals.yaml.cgi".into(), Compressor::None, "autoremovals.yaml".into(), )] } #[derive(Debug)] pub(crate) struct Cache { base_directory: BaseDirectories, downloader: Downloader, archive_mirror: String, unstable: release::Release, testing: release::Release, stable: release::Release, oldstable: release::Release, experimental: release::Release, stable_proposed_updates: release::Release, oldstable_proposed_updates: release::Release, stable_backports: release::Release, // oldstable_backports: release::Release, } fn empty_release() -> release::Release { release::Release { origin: Default::default(), label: Default::default(), suite: Suite::Unstable, codename: Codename::Sid, version: Default::default(), date: Default::default(), valid_until: Default::default(), acquire_by_hash: Default::default(), architectures: Default::default(), components: Default::default(), description: Default::default(), files: Default::default(), } } impl Cache { pub async fn new(force_download: bool, archive_mirror: &str) -> Result { let mut cache = Self { base_directory: BaseDirectories::with_prefix("Debian-RT-tools")?, downloader: Downloader::new(force_download), archive_mirror: archive_mirror.into(), unstable: empty_release(), testing: empty_release(), stable: empty_release(), oldstable: empty_release(), experimental: empty_release(), stable_proposed_updates: empty_release(), oldstable_proposed_updates: empty_release(), stable_backports: empty_release(), // oldstable_backports: empty_release(), }; // download Release files for unstable, testing and stable cache .download(&[ CacheEntries::Release(Suite::Unstable), CacheEntries::Release(Suite::Testing(None)), CacheEntries::Release(Suite::Stable(None)), CacheEntries::Release(Suite::OldStable(None)), CacheEntries::Release(Suite::Experimental), CacheEntries::Release(Suite::Stable(Some(Extension::ProposedUpdates))), CacheEntries::Release(Suite::OldStable(Some(Extension::ProposedUpdates))), CacheEntries::Release(Suite::Stable(Some(Extension::Backports))), // CacheEntries::Release(Suite::OldStable(Some(Extension::Backports))), ]) .await?; cache.unstable = release::from_reader( cache.get_cache_bufreader(format!("Release_{}", Suite::Unstable))?, )?; cache.testing = release::from_reader( cache.get_cache_bufreader(format!("Release_{}", Suite::Testing(None)))?, )?; cache.stable = release::from_reader( cache.get_cache_bufreader(format!("Release_{}", Suite::Stable(None)))?, )?; cache.oldstable = release::from_reader( cache.get_cache_bufreader(format!("Release_{}", Suite::OldStable(None)))?, )?; cache.experimental = release::from_reader( cache.get_cache_bufreader(format!("Release_{}", Suite::Experimental))?, )?; cache.stable_proposed_updates = release::from_reader(cache.get_cache_bufreader(format!( "Release_{}", Suite::Stable(Some(Extension::ProposedUpdates)) ))?)?; cache.oldstable_proposed_updates = release::from_reader(cache.get_cache_bufreader(format!( "Release_{}", Suite::OldStable(Some(Extension::ProposedUpdates)) ))?)?; cache.stable_backports = release::from_reader(cache.get_cache_bufreader(format!( "Release_{}", Suite::Stable(Some(Extension::Backports)) ))?)?; // cache.oldstable_backports = release::from_reader(cache.get_cache_bufreader(format!( // "Release_{}", // Suite::OldStable(Some(Extension::Backports)) // ))?)?; Ok(cache) } fn lookup_url(&self, suite: Suite, path: &str) -> String { format!( "{}/dists/{}/{}", self.archive_mirror, suite, match suite { Suite::Unstable => &self.unstable, Suite::Testing(_) => &self.testing, Suite::Stable(None) => &self.stable, Suite::OldStable(None) => &self.oldstable, Suite::Experimental => &self.experimental, Suite::Stable(Some(Extension::ProposedUpdates)) => &self.stable_proposed_updates, Suite::OldStable(Some(Extension::ProposedUpdates)) => &self.oldstable_proposed_updates, Suite::Stable(Some(Extension::Backports)) => &self.stable_backports, // Suite::OldStable(Some(Extension::Backports)) => &self.oldstable_backports, _ => unreachable!("Suite {} is currently not handled.", suite), } .lookup_url(path) .expect("file needs to be available") ) } fn contents_urls( &self, suite: Suite, ) -> Vec<(Cow<'static, str>, Compressor, Cow<'static, str>)> { self.architectures_for_suite(suite) .into_iter() .map(|architecture| { ( self.lookup_url(suite, &format!("main/Contents-{}.gz", architecture)) .into(), Compressor::Gz, format!("Contents_{}_{}", suite, architecture).into(), ) }) .collect() } fn packages_urls( &self, suite: Suite, ) -> Vec<(Cow<'static, str>, Compressor, Cow<'static, str>)> { self.architectures_for_suite(suite) .into_iter() .map(|architecture| { ( self.lookup_url(suite, &format!("main/binary-{}/Packages.xz", architecture)) .into(), Compressor::Xz, format!("Packages_{}_{}", suite, architecture).into(), ) }) .collect() } fn source_urls(&self, suite: Suite) -> Vec<(Cow<'static, str>, Compressor, Cow<'static, str>)> { vec![( self.lookup_url(suite, "main/source/Sources.xz").into(), Compressor::Xz, format!("Sources_{}", suite).into(), )] } fn release_urls( &self, suite: Suite, ) -> Vec<(Cow<'static, str>, Compressor, Cow<'static, str>)> { vec![( format!("{}/dists/{}/Release", self.archive_mirror, suite).into(), Compressor::None, format!("Release_{}", suite).into(), )] } fn cache_entries_to_urls_dests( &self, entries: &[CacheEntries], ) -> Result, Compressor, PathBuf)>> { entries .iter() .flat_map(|entry| { match entry { CacheEntries::Excuses => excuses_urls(), CacheEntries::Packages(suite) => self.packages_urls(*suite), CacheEntries::Sources(suite) => self.source_urls(*suite), CacheEntries::FTBFSBugs(codename) => ftbfs_bugs_urls(*codename), CacheEntries::AutoRemovals => auto_removals_urls(), CacheEntries::Contents(suite) => self.contents_urls(*suite), CacheEntries::Release(suite) => self.release_urls(*suite), } .into_iter() }) .map(|(url, compressor, dest)| { Ok((url, compressor, self.get_cache_path(dest.as_ref())?)) }) .collect() } pub async fn download(&self, entries: &[CacheEntries]) -> Result { let urls_and_dests = self.cache_entries_to_urls_dests(entries)?; trace!( "Scheduling {} URLs to download: {:?}", urls_and_dests.len(), urls_and_dests ); let mp = MultiProgress::new(); let join_handles: Vec<_> = urls_and_dests .into_iter() .map(|(url, compressor, dest)| { let downloader = self.downloader.clone(); let mp = mp.clone(); tokio::spawn(async move { debug!("Starting task to download {}", url); downloader.download_file(&url, dest, compressor, mp).await }) }) .collect(); let mut state = Ok(CacheState::NoUpdate); for handle in join_handles { match handle.await { Ok(download_result) => match download_result { Ok(CacheState::FreshFiles) => { if state.is_ok() { state = Ok(CacheState::FreshFiles); } } Err(err) => state = Err(err), _ => {} }, Err(err) => state = Err(err.into()), }; } state } pub fn get_cache_path

(&self, path: P) -> Result where P: AsRef, { Ok(self.base_directory.place_cache_file(path)?) } pub fn get_cache_bufreader

(&self, path: P) -> Result> where P: AsRef, { Ok(BufReader::new(File::open(self.get_cache_path(path)?)?)) } pub fn get_data_bufreader

(&self, path: P) -> Result> where P: AsRef, { Ok(BufReader::new(File::open( self.base_directory.place_data_file(path)?, )?)) } pub fn get_data_bufwriter

(&self, path: P) -> Result> where P: AsRef, { Ok(BufWriter::new(File::create( self.base_directory.place_data_file(path)?, )?)) } pub fn get_package_paths(&self, suite: Suite, with_all: bool) -> Result> { let mut all_paths = vec![]; for architecture in self.architectures_for_suite(suite) { if !with_all && architecture == Architecture::All { continue; } all_paths.push(self.get_cache_path(format!("Packages_{}_{}", suite, architecture))?); } Ok(all_paths) } pub fn get_source_path(&self, suite: Suite) -> Result { self.get_cache_path(format!("Sources_{}", suite)) } pub fn get_content_paths(&self, suite: Suite) -> Result> { let mut all_paths = vec![]; for architecture in self.architectures_for_suite(suite) { all_paths.push(( architecture, self.get_cache_path(format!("Contents_{}_{}", suite, architecture))?, )); } Ok(all_paths) } // Architectures for a suite (including Arch: all) pub fn architectures_for_suite(&self, suite: Suite) -> Vec { match suite { Suite::Unstable | Suite::Experimental => self.unstable.architectures.clone(), Suite::Testing(_) => self.testing.architectures.clone(), Suite::Stable(_) => self.stable.architectures.clone(), Suite::OldStable(_) => self.oldstable.architectures.clone(), } } } /// Check if package should be skipped for binNMUs. pub fn source_skip_binnmu(source: &str) -> bool { source.starts_with("debian-installer") || source == "linux" || (source.contains("-signed") && (source.starts_with("grub-") || source.starts_with("linux-") || source.starts_with("shim-") || source.starts_with("fwupd-"))) } #[cfg(test)] mod test { use super::*; #[test] fn skip_binnmu() { assert!(source_skip_binnmu("linux-signed-i386")); assert!(!source_skip_binnmu("zathura-signed-foo")); } } drt-tools-0.2.20/src/grep_excuses.rs000064400000000000000000000057451046102023000155000ustar 00000000000000// Copyright 2022-2023 Sebastian Ramacher // SPDX-License-Identifier: LGPL-3.0-or-later use anyhow::Result; use assorted_debian_utils::{ autoremovals::{self, AutoRemoval}, excuses::{self, ExcusesItem}, }; use async_trait::async_trait; use chrono::Utc; use clap::Parser; use crate::{ config::{self, CacheEntries}, Command, }; #[derive(Debug, Parser)] pub(crate) struct GrepExcusesOptions { /// Currently not implemented #[clap(long)] autopkgtests: bool, /// The maintainer or package to grep for maintainer_package: String, } pub(crate) struct GrepExcuses<'a> { cache: &'a config::Cache, options: GrepExcusesOptions, } impl<'a> GrepExcuses<'a> { pub(crate) fn new(cache: &'a config::Cache, options: GrepExcusesOptions) -> Self { Self { cache, options } } fn print_excuse(&self, excuse: &ExcusesItem) { println!( "{} ({} to {})", excuse.source, excuse .old_version .as_ref() .map_or_else(|| "-".into(), |version| version.to_string()), excuse .new_version .as_ref() .map_or_else(|| "-".into(), |version| version.to_string()) ); if let Some(maintainer) = &excuse.maintainer { println!(" Maintainer: {}", maintainer); } for line in &excuse.excuses { println!(" {}", voca_rs::strip::strip_tags(line)); } } fn print_autoremoal(&self, autoremoval: &AutoRemoval) { println!("{} (AUTOREMOVAL)", autoremoval.source); let time_diff = autoremoval.removal_date - Utc::now(); println!( " flagged for removal in {} days ({})", time_diff.num_days(), autoremoval.removal_date.to_rfc2822() ); // TODO: print other fields } } #[async_trait] impl Command for GrepExcuses<'_> { async fn run(&self) -> Result<()> { // parse excuses let excuses = excuses::from_reader(self.cache.get_cache_bufreader("excuses.yaml")?)?; // parse autoremovals let autoremovals = autoremovals::from_reader(self.cache.get_cache_bufreader("autoremovals.yaml")?)?; // first print the autoremoval if let Some(autoremoval) = autoremovals.get(&self.options.maintainer_package) { self.print_autoremoal(autoremoval); } // then print the excuses for excuse in excuses.sources { if excuse.source == self.options.maintainer_package { self.print_excuse(&excuse); continue; } if let Some(maintainer) = &excuse.maintainer { if maintainer == &self.options.maintainer_package { self.print_excuse(&excuse); continue; } } } Ok(()) } fn downloads(&self) -> Vec { vec![CacheEntries::Excuses, CacheEntries::AutoRemovals] } } drt-tools-0.2.20/src/main.rs000064400000000000000000000166271046102023000137310ustar 00000000000000// Copyright 2021-2023 Sebastian Ramacher // SPDX-License-Identifier: GPL-3.0-or-later use anyhow::{Context, Result}; use assorted_debian_utils::{architectures::Architecture, archive::SuiteOrCodename}; use async_trait::async_trait; use clap::{Parser, Subcommand}; use config::{CacheEntries, CacheState}; use log::trace; mod binnmu_buildinfo; pub(crate) mod config; mod grep_excuses; mod nmu_eso; mod nmu_transition; mod nmu_versionskew; mod process_excuses; mod process_unblocks; pub(crate) mod source_packages; pub(crate) mod udd_bugs; mod usrmerged; use binnmu_buildinfo::{BinNMUBuildinfo, BinNMUBuildinfoOptions}; use grep_excuses::{GrepExcuses, GrepExcusesOptions}; use nmu_eso::{NMUOutdatedBuiltUsing, NMUOutdatedBuiltUsingOptions}; use nmu_transition::{NMUTransition, NMUTransitionOptions}; use nmu_versionskew::{NMUVersionSkew, NMUVersionSkewOptions}; use process_excuses::{ProcessExcuses, ProcessExcusesOptions}; use process_unblocks::ProcessUnblocks; use usrmerged::{UsrMerged, UsrMergedOptions}; #[derive(Debug, Parser)] pub(crate) struct BaseOptions { /// Force download of files #[clap(long)] force_download: bool, /// Force processing #[clap(short, long = "force")] force_processing: bool, /// Only print actions to perform without running any commands #[clap(short = 'n')] dry_run: bool, #[clap(flatten)] verbose: clap_verbosity_flag::Verbosity, /// Archive mirror #[clap(long, default_value = "https://deb.debian.org/debian")] mirror: String, } #[derive(Debug, Parser)] pub(crate) struct BinNMUsOptions { /// Message for binNMUs #[clap(short, long)] message: String, /// Build priority. If specified, the binNMUs are scheduled with the given build priority. Builds with a positive priority will be built earlier. #[clap(long = "bp")] build_priority: Option, /// Dependency-wait. If specified, the builds will wait until the given dependency relation is satisfied. #[clap(long = "dw")] dep_wait: Option, /// Extra dependencies. If specified, the given dependency will be installed during the build. #[clap(long)] extra_depends: Option, /// Suite for binNMUs. #[clap(short, long, default_value = "unstable")] suite: SuiteOrCodename, /// Set architectures for binNMUs. If no archictures are specified, the binNMUs are scheduled with ANY. #[clap(short, long)] architecture: Option>, } #[derive(Debug, Parser)] struct DrtToolsOptions { #[clap(flatten)] base_options: BaseOptions, #[clap(subcommand)] command: DrtToolsCommands, } #[derive(Debug, Subcommand)] enum DrtToolsCommands { /// Process current excuses.yaml and prepare a list of binNMUs required for testing migration. ProcessExcuses(ProcessExcusesOptions), /// Prepare and schedule binNMUs for a transition. /// /// This command expects a list of packages with their respective versions /// from ben. Each line should look like this: /// /// haskell-pandoc-citeproc [build logs] (0.17.0.1-1) ✘ ✘ ✘ ✘ ✘ ✘ ✘ ✘ ✘ /// /// Note that any information from ben except the source package and the /// version are ignored. Per default, binNMUs are scheduled with ANY /// in unstable. /// /// The list of packages can be either given on the standard input or they /// are read from a file. #[clap(name = "nmu-transition")] NMUTransition(NMUTransitionOptions), /// Prepare binNMUs based on a list of buildinfo files #[clap(name = "nmu-buildinfo")] NMUBuildinfo(BinNMUBuildinfoOptions), /// Grep excuses #[clap(name = "grep-excuses")] GrepExcuses(GrepExcusesOptions), /// Prepare binNMUs to rebuild for outdated Built-Using /// /// Based on the `Extra-Source-Only` flag, this command prepares and /// schedules binNMUs for packages with outdated `Built-Using` fields. #[clap(name = "nmu-eso")] NMUOutdatedBuiltUsing(NMUOutdatedBuiltUsingOptions), /// Check state of /usr-merged bugs /// /// Currently, a moratorium is in place that forbids files to move from /// `/{bin,lib}` to `/usr/{bin,lib}` or vice-versa if the file moves from /// one binary package to another at the same time. This tool tries to find /// all occurrences of all files violating this rule between stable and /// testing. /// /// Note that this subcommand requires at least 2 GB of available RAM. #[clap(name = "usrmerged")] UsrMerged(UsrMergedOptions), /// Prepare a list of unblocks /// /// This command parses the current excuses and prepares a list of packages /// in testing-proposed-updates and packages that have been rebuilt in /// unstable but are blocked by the freeze. ProcessUnblocks, /// Prepare rebuilds for version skew in Multi-Arch: same packages #[clap(name = "nmu-version-skew")] NMUVersionSkew(NMUVersionSkewOptions), } #[async_trait] pub(crate) trait Command { /// Cache entries that need to be downloaded and in fresh state. fn required_downloads(&self) -> Vec { Vec::new() } /// Cache entries that need to be downloaded fn downloads(&self) -> Vec { Vec::new() } /// Execture the command async fn run(&self) -> Result<()>; } async fn execute_command( cache: &config::Cache, command: &dyn Command, force_processing: bool, ) -> Result<()> { let to_download = command.required_downloads(); if !to_download.is_empty() && cache.download(&to_download).await? == CacheState::NoUpdate && !force_processing { trace!("all files are up-to-date; nothing to do"); return Ok(()); } cache.download(&command.downloads()).await?; command.run().await } #[tokio::main] async fn main() -> Result<()> { let opts = DrtToolsOptions::parse(); stderrlog::new() .verbosity(opts.base_options.verbose.log_level_filter()) .init() .with_context(|| "Failed to initialize `stderrlog`.")?; trace!("base options {:?}", opts.base_options); trace!("command: {:?}", opts.command); let cache = config::Cache::new(opts.base_options.force_download, &opts.base_options.mirror).await?; let command: Box = match opts.command { DrtToolsCommands::ProcessExcuses(pe_opts) => { Box::new(ProcessExcuses::new(&cache, &opts.base_options, pe_opts)) } DrtToolsCommands::NMUTransition(pbm_opts) => { Box::new(NMUTransition::new(&cache, &opts.base_options, pbm_opts)) } DrtToolsCommands::NMUBuildinfo(bb_opts) => { Box::new(BinNMUBuildinfo::new(&cache, &opts.base_options, bb_opts)) } DrtToolsCommands::GrepExcuses(ge_opts) => Box::new(GrepExcuses::new(&cache, ge_opts)), DrtToolsCommands::NMUOutdatedBuiltUsing(eso_opts) => Box::new( NMUOutdatedBuiltUsing::new(&cache, &opts.base_options, eso_opts), ), DrtToolsCommands::UsrMerged(um_opts) => Box::new(UsrMerged::new(&cache, um_opts)), DrtToolsCommands::ProcessUnblocks => Box::new(ProcessUnblocks::new(&cache)), DrtToolsCommands::NMUVersionSkew(vs_opts) => { Box::new(NMUVersionSkew::new(&cache, &opts.base_options, vs_opts)) } }; execute_command(&cache, command.as_ref(), opts.base_options.force_processing).await } drt-tools-0.2.20/src/nmu_eso.rs000064400000000000000000000371111046102023000144410ustar 00000000000000// Copyright 2021-2023 Sebastian Ramacher // SPDX-License-Identifier: GPL-3.0-or-later use std::{ collections::{HashMap, HashSet}, fmt, iter::FusedIterator, path::Path, str::FromStr, vec::IntoIter, }; use anyhow::Result; use assorted_debian_utils::{ architectures::Architecture, archive::{Codename, Extension, Suite, SuiteOrCodename}, rfc822_like, version::PackageVersion, wb::{BinNMU, SourceSpecifier, WBCommandBuilder}, }; use async_trait::async_trait; use clap::Parser; use indicatif::{ProgressBar, ProgressBarIter, ProgressIterator}; use itertools::Itertools; use log::{debug, trace}; use serde::Deserialize; use crate::{ config::{ default_progress_style, default_progress_template, source_skip_binnmu, Cache, CacheEntries, }, udd_bugs::{load_bugs_from_reader, UDDBugs}, BaseOptions, Command, }; #[derive(Deserialize, Debug, Eq, PartialEq)] #[serde(rename_all = "PascalCase")] struct BinaryPackage { source: Option, package: String, version: PackageVersion, architecture: Architecture, #[serde(rename = "Built-Using")] built_using: Option, #[serde(rename = "Static-Built-Using")] static_built_using: Option, } #[derive(Deserialize, Debug, Eq, PartialEq)] #[serde(rename_all = "PascalCase")] struct SourcePackage { package: String, version: PackageVersion, } #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum Field { BuiltUsing, StaticBuiltUsing, } impl fmt::Display for Field { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Field::BuiltUsing => write!(f, "Built-Using"), Field::StaticBuiltUsing => write!(f, "Static-Built-Using"), } } } #[derive(Debug, thiserror::Error)] pub struct ParseError; impl fmt::Display for ParseError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "invalid reference field") } } impl FromStr for Field { type Err = ParseError; fn from_str(s: &str) -> std::result::Result { match s { "Built-Using" => Ok(Field::BuiltUsing), "Static-Built-Using" => Ok(Field::StaticBuiltUsing), _ => Err(ParseError), } } } #[derive(Debug, Parser)] pub(crate) struct NMUOutdatedBuiltUsingOptions { /// Build priority. If specified, the binNMUs are scheduled with the given build priority. Builds with a positive priority will be built earlier. #[clap(long = "bp", default_value_t = -50)] build_priority: i32, /// Suite for binNMUs. #[clap(short, long, default_value_t = SuiteOrCodename::Suite(Suite::Unstable))] suite: SuiteOrCodename, /// Set architectures for binNMUs. If no archictures are specified, the binNMUs are scheduled with ANY. #[clap(short, long)] architecture: Option>, #[clap(long, default_value_t = Field::BuiltUsing)] field: Field, } #[derive(PartialEq, Eq, Hash)] struct OutdatedPackage { source: String, version: PackageVersion, suite: Suite, outdated_dependency: String, outdated_version: PackageVersion, } #[derive(PartialEq, Eq)] struct CombinedOutdatedPackage { source: String, version: PackageVersion, suite: Suite, outdated_dependencies: Vec<(String, PackageVersion)>, } impl PartialOrd for CombinedOutdatedPackage { fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } } impl Ord for CombinedOutdatedPackage { fn cmp(&self, other: &Self) -> std::cmp::Ordering { (&self.source, &self.version).cmp(&(&other.source, &other.version)) } } fn split_dependency(dependency: &str) -> Option<(String, PackageVersion)> { // this should never fail unless the archive is broken dependency.split_once(' ').and_then(|(source, version)| { PackageVersion::try_from(&version[3..version.len() - 1]) .map(|version| (source.to_string(), version)) .ok() }) } struct BinaryPackageParser<'a> { field: Field, iterator: ProgressBarIter>, sources: &'a HashMap, } impl<'a> BinaryPackageParser<'a> { fn new

(field: Field, sources: &'a HashMap, path: P) -> Result where P: AsRef, { // read Package file let binary_packages: Vec = rfc822_like::from_file(path.as_ref())?; let pb = ProgressBar::new(binary_packages.len() as u64); pb.set_style(default_progress_style().template(default_progress_template())?); pb.set_message(format!("Processing {}", path.as_ref().display())); // collect all sources with arch dependent binaries having Built-Using set and their Built-Using fields Ok(Self { field, iterator: binary_packages.into_iter().progress_with(pb), sources, }) } } impl Iterator for BinaryPackageParser<'_> { type Item = (String, PackageVersion, HashSet<(String, PackageVersion)>); fn next(&mut self) -> Option { while let Some(binary_package) = self.iterator.next() { // skip Arch: all packages if binary_package.architecture == Architecture::All { continue; } // skip packages without Built-Using let Some(ref built_using) = (match self.field { Field::BuiltUsing => binary_package.built_using, Field::StaticBuiltUsing => binary_package.static_built_using, }) else { continue; }; let source_package = if let Some(source_package) = &binary_package.source { match source_package.split_whitespace().next() { Some(package) => package.into(), None => continue, } } else { // no Source set, so Source == Package binary_package.package }; let built_using: HashSet<_> = built_using .split(", ") .filter_map(split_dependency) .filter(|(source, version)| { if let Some(max_version) = self.sources.get(source) { version < max_version } else { // This can happen when considering packages with // Static-Built-Using, but never with Built-Using. Let's // rebuild those packages in any case. trace!( "Package '{}' refers to non-existing source package '{}'.", source_package, source ); true } }) .collect(); // all packages in Built-Using are up to date if built_using.is_empty() { trace!( "Skipping {}: all dependencies in {} are up-to-date.", source_package, self.field ); continue; } return Some(( source_package, binary_package.version.without_binnmu_version(), built_using, )); } None } } impl FusedIterator for BinaryPackageParser<'_> {} pub(crate) struct NMUOutdatedBuiltUsing<'a> { cache: &'a Cache, base_options: &'a BaseOptions, options: NMUOutdatedBuiltUsingOptions, } impl<'a> NMUOutdatedBuiltUsing<'a> { pub(crate) fn new( cache: &'a Cache, base_options: &'a BaseOptions, options: NMUOutdatedBuiltUsingOptions, ) -> Self { Self { cache, base_options, options, } } fn load_bugs(&self, codename: Codename) -> Result { load_bugs_from_reader( self.cache .get_cache_bufreader(format!("udd-ftbfs-bugs-{}.yaml", codename))?, ) } /// Load source packages with the highest version fn load_sources

(path: P, destination: &mut HashMap) -> Result<()> where P: AsRef, { let sources: Vec = rfc822_like::from_file(path.as_ref())?; for source in sources { destination .entry(source.package) .and_modify(|version| { if source.version > *version { *version = source.version.clone() } }) .or_insert(source.version); } Ok(()) } /// Load source packages from multiple suites with the highest version fn load_sources_for_suites(&self, suites: &[Suite]) -> Result> { let mut ret: HashMap = Default::default(); for suite in suites { Self::load_sources(self.cache.get_source_path(*suite)?, &mut ret)?; } Ok(ret) } fn load_eso(&self, field: Field, suite: Suite) -> Result> { let codename = suite.into(); let ftbfs_bugs = self.load_bugs(codename)?; let source_packages = self.load_sources_for_suites(&self.expand_suite_for_sources())?; let mut packages = HashSet::new(); for suite in self.expand_suite_for_binaries() { for path in self.cache.get_package_paths(suite, false)? { for (source, version, dependencies) in BinaryPackageParser::new(field, &source_packages, path)? { packages.extend(dependencies.into_iter().map( |(outdated_dependency, outdated_version)| OutdatedPackage { source: source.clone(), version: version.clone(), suite, outdated_dependency, outdated_version, }, )) } } } let mut result = HashMap::<(String, Suite), HashSet<(PackageVersion, String, PackageVersion)>>::new(); for outdated_package in packages { // skip some packages that make no sense to binNMU if source_skip_binnmu(&outdated_package.source) { debug!( "Skipping {}: signed or d-i package", outdated_package.source ); continue; } // check if package FTBFS if let Some(bugs) = ftbfs_bugs.bugs_for_source(&outdated_package.source) { println!( "# Skipping {} due to FTBFS bugs ...", outdated_package.source ); for bug in bugs { debug!( "Skipping {}: #{} - {}: {}", outdated_package.source, bug.id, bug.severity, bug.title ); } continue; } result .entry((outdated_package.source, outdated_package.suite)) .or_default() .insert(( outdated_package.version, outdated_package.outdated_dependency, outdated_package.outdated_version, )); } Ok(result .into_iter() .filter_map(|((source, suite), outdated_dependencies)| { let Some(max_version) = outdated_dependencies .iter() .map(|(version, _, _)| version) .max() .cloned() else { return None; }; Some(CombinedOutdatedPackage { source, version: max_version.clone(), suite, outdated_dependencies: outdated_dependencies .into_iter() .filter_map(|(version, outdated_dependency, outdated_version)| { if version == max_version { Some((outdated_dependency, outdated_version)) } else { None } }) .sorted() .collect(), }) }) .sorted() .collect()) } fn expand_suite_for_sources(&self) -> Vec { let suite: Suite = self.options.suite.into(); match suite { // when looking at testing, ignore testing-proposed-updates Suite::Testing(_) | Suite::Unstable | Suite::Experimental => vec![suite], // when looking at stable, consider stable and proposed-updates Suite::Stable(None) | Suite::OldStable(None) => { vec![suite, suite.with_extension(Extension::ProposedUpdates)] } // always consider base suite as well Suite::Stable(Some(_)) | Suite::OldStable(Some(_)) => { vec![suite.without_extension(), suite] } } } fn expand_suite_for_binaries(&self) -> Vec { let suite: Suite = self.options.suite.into(); match suite { // when looking at testing, ignore testing-proposed-updates Suite::Testing(_) | Suite::Unstable | Suite::Experimental => vec![suite], // when looking at stable, consider stable and proposed-updates Suite::Stable(None) | Suite::OldStable(None) => { vec![suite, suite.with_extension(Extension::ProposedUpdates)] } Suite::Stable(Some(_)) | Suite::OldStable(Some(_)) => { vec![suite] } } } } #[async_trait] impl Command for NMUOutdatedBuiltUsing<'_> { async fn run(&self) -> Result<()> { let suite = self.options.suite.into(); let eso_sources = self.load_eso(self.options.field, suite)?; for outdated_package in eso_sources { let mut source = SourceSpecifier::new(&outdated_package.source); source.with_version(&outdated_package.version); source.with_suite(outdated_package.suite.into()); if let Some(architectures) = &self.options.architecture { source.with_archive_architectures(architectures); } let message = format!( "Rebuild for outdated {} ({})", self.options.field, outdated_package .outdated_dependencies .into_iter() .map(|(source, version)| format!("{}/{}", source, version)) .join(", ") ); let mut binnmu = BinNMU::new(&source, &message)?; binnmu.with_build_priority(self.options.build_priority); let command = binnmu.build(); println!("{}", command); if !self.base_options.dry_run { command.execute()?; } } Ok(()) } fn downloads(&self) -> Vec { vec![CacheEntries::FTBFSBugs(self.options.suite.into())] } fn required_downloads(&self) -> Vec { self.expand_suite_for_binaries() .into_iter() .map(CacheEntries::Packages) .chain( self.expand_suite_for_sources() .into_iter() .map(CacheEntries::Sources), ) .collect() } } drt-tools-0.2.20/src/nmu_transition.rs000064400000000000000000000112171046102023000160440ustar 00000000000000// Copyright 2021-2023 Sebastian Ramacher // SPDX-License-Identifier: GPL-3.0-or-later use std::fs::File; use std::io::{self, BufRead, BufReader}; use std::path::PathBuf; use anyhow::Result; use assorted_debian_utils::{ archive::Codename, wb::{BinNMU, SourceSpecifier, WBCommandBuilder}, }; use async_trait::async_trait; use clap::Parser; use log::{debug, warn}; use crate::Command; use crate::{ config::{self, CacheEntries}, udd_bugs::{load_bugs_from_reader, UDDBugs}, BaseOptions, BinNMUsOptions, }; #[derive(Debug, Parser)] pub(crate) struct NMUTransitionOptions { #[clap(flatten)] binnmu_options: BinNMUsOptions, /// Input file with a list of packages. If not specified, the list of packages will be read from the standard input. input: Option, } pub(crate) struct NMUTransition<'a> { cache: &'a config::Cache, base_options: &'a BaseOptions, options: NMUTransitionOptions, } impl<'a> NMUTransition<'a> { pub(crate) fn new( cache: &'a config::Cache, base_options: &'a BaseOptions, options: NMUTransitionOptions, ) -> Self { Self { cache, base_options, options, } } fn load_bugs(&self, codename: &Codename) -> Result { load_bugs_from_reader( self.cache .get_cache_bufreader(format!("udd-ftbfs-bugs-{}.yaml", codename))?, ) } } #[async_trait] impl Command for NMUTransition<'_> { async fn run(&self) -> Result<()> { let codename: Codename = self.options.binnmu_options.suite.into(); let ftbfs_bugs = if !self.base_options.force_processing { self.load_bugs(&codename)? } else { UDDBugs::new(vec![]) }; let reader: Box = match &self.options.input { None => Box::new(BufReader::new(io::stdin())), Some(filename) => Box::new(BufReader::new(File::open(filename)?)), }; let mut wb_commands = Vec::new(); for line in reader.lines() { let Ok(line) = line else { break; }; if line.starts_with("Dependency level") || line.is_empty() { continue; } // possible formats: // package [build logs] (version) ... // package (sid only) [build logs] (version) ... let version_index = if line.contains("(sid only)") { 5 } else { 3 }; let split_line: Vec<_> = line.split_whitespace().collect(); if split_line.len() <= version_index { println!("Skipping unsupported format: {}", line); continue; } let source = split_line[0]; let version = split_line[version_index]; let Some(version) = version.strip_prefix('(').and_then(|v| v.strip_suffix(')')) else { warn!("Unable to parse version: {:?} / {:?}", source, version); continue; }; if let Some(bugs) = ftbfs_bugs.bugs_for_source(source) { debug!("Skipping {} due to FTBFS bugs: {:?}", source, bugs); println!("# Skipping {} due to FTBFS bugs", source); continue; } let mut source = SourceSpecifier::new(source); let Ok(version) = version.try_into() else { warn!("Unable to parse version: {:?} / {:?}", source, version); continue; }; source .with_version(&version) .with_suite(self.options.binnmu_options.suite); if let Some(architectures) = &self.options.binnmu_options.architecture { source.with_archive_architectures(architectures); } let mut binnmu = BinNMU::new(&source, &self.options.binnmu_options.message)?; if let Some(bp) = self.options.binnmu_options.build_priority { binnmu.with_build_priority(bp); } if let Some(dw) = &self.options.binnmu_options.dep_wait { binnmu.with_dependency_wait(dw); } if let Some(extra_depends) = &self.options.binnmu_options.extra_depends { binnmu.with_extra_depends(extra_depends); } wb_commands.push(binnmu.build()) } for commands in wb_commands { println!("{}", commands); if !self.base_options.dry_run { commands.execute()?; } } Ok(()) } fn downloads(&self) -> Vec { vec![CacheEntries::FTBFSBugs( self.options.binnmu_options.suite.into(), )] } } drt-tools-0.2.20/src/nmu_versionskew.rs000064400000000000000000000211201046102023000162230ustar 00000000000000// Copyright 2023 Sebastian Ramacher // SPDX-License-Identifier: GPL-3.0-or-later use std::{ collections::{HashMap, HashSet}, iter::FusedIterator, path::Path, vec::IntoIter, }; use anyhow::{Context, Result}; use assorted_debian_utils::{ architectures::Architecture, archive::{Codename, MultiArch, Suite, SuiteOrCodename}, rfc822_like, version::PackageVersion, wb::{BinNMU, SourceSpecifier, WBCommandBuilder}, }; use async_trait::async_trait; use clap::Parser; use indicatif::{ProgressBar, ProgressBarIter, ProgressIterator}; use itertools::Itertools; use log::{debug, error}; use serde::Deserialize; use crate::{ config::{ default_progress_style, default_progress_template, source_skip_binnmu, Cache, CacheEntries, }, udd_bugs::{load_bugs_from_reader, UDDBugs}, BaseOptions, Command, }; #[derive(Deserialize, Debug, Eq, PartialEq)] #[serde(rename_all = "PascalCase")] struct BinaryPackage { source: Option, package: String, version: PackageVersion, architecture: Architecture, #[serde(rename = "Multi-Arch")] multi_arch: Option, } #[derive(Debug, Parser)] pub(crate) struct NMUVersionSkewOptions { /// Build priority. If specified, the binNMUs are scheduled with the given build priority. Builds with a positive priority will be built earlier. #[clap(long = "bp", default_value_t = -50)] build_priority: i32, /// Suite for binNMUs. #[clap(short, long, default_value_t = SuiteOrCodename::Suite(Suite::Unstable))] suite: SuiteOrCodename, } struct BinaryPackageParser { iterator: ProgressBarIter>, } impl BinaryPackageParser { fn new

(path: P) -> Result where P: AsRef, { // read Package file let binary_packages: Vec = rfc822_like::from_file(path.as_ref()) .with_context(|| { format!("Failed to parse packages from {}", path.as_ref().display()) })?; let pb = ProgressBar::new(binary_packages.len() as u64); pb.set_style(default_progress_style().template(default_progress_template())?); pb.set_message(format!("Processing {}", path.as_ref().display())); // collect all sources with arch dependent binaries having Built-Using set and their Built-Using fields Ok(Self { iterator: binary_packages.into_iter().progress_with(pb), }) } } impl Iterator for BinaryPackageParser { type Item = (String, Architecture, PackageVersion); fn next(&mut self) -> Option { for binary_package in self.iterator.by_ref() { // skip packages that are not MA: same if binary_package.multi_arch != Some(MultiArch::Same) { continue; } // skip Arch: all packages if binary_package.architecture == Architecture::All { continue; } return Some(( if let Some(source_package) = &binary_package.source { match source_package.split_whitespace().next() { Some(package) => package.into(), None => continue, } } else { // no Source set, so Source == Package binary_package.package }, binary_package.architecture, binary_package.version, )); } None } } impl FusedIterator for BinaryPackageParser {} pub(crate) struct NMUVersionSkew<'a> { cache: &'a Cache, base_options: &'a BaseOptions, options: NMUVersionSkewOptions, } impl<'a> NMUVersionSkew<'a> { pub(crate) fn new( cache: &'a Cache, base_options: &'a BaseOptions, options: NMUVersionSkewOptions, ) -> Self { Self { cache, base_options, options, } } fn load_bugs(&self, codename: Codename) -> Result { load_bugs_from_reader( self.cache .get_cache_bufreader(format!("udd-ftbfs-bugs-{}.yaml", codename))?, ) } fn load_version_skew( &self, suite: Suite, ) -> Result)>> { let codename = suite.into(); let ftbfs_bugs = self .load_bugs(codename) .with_context(|| format!("Failed to load bugs for {}", codename))?; let mut packages: HashMap> = HashMap::new(); for path in self.cache.get_package_paths(suite, false)? { for (source, architecture, version) in BinaryPackageParser::new(path)? { // skip some packages that make no sense to binNMU if source_skip_binnmu(&source) { continue; } if let Some(info) = packages.get_mut(&source) { info.insert((architecture, version)); } else { packages.insert(source, { let mut hs = HashSet::new(); hs.insert((architecture, version)); hs }); } } } let mut sources_architectures = Vec::<(String, PackageVersion, Vec)>::default(); for (source, source_info) in packages.into_iter().sorted_by_key(|value| value.0.clone()) { let all_versions: HashSet<&PackageVersion> = HashSet::from_iter(source_info.iter().map(|(_, version)| version)); if all_versions.len() == 1 { debug!("Skipping {}: package is in sync", source); continue; } let all_versions_without_binnmu: HashSet = HashSet::from_iter( source_info .iter() .map(|(_, version)| version.clone().without_binnmu_version()), ); if all_versions_without_binnmu.len() != 1 { debug!( "Skipping {}: package is out-of-date on some architecture", source ); continue; } // check if package FTBFS if let Some(bugs) = ftbfs_bugs.bugs_for_source(&source) { println!("# Skipping {} due to FTBFS bugs ...", source); for bug in bugs { debug!( "Skipping {}: #{} - {}: {}", source, bug.id, bug.severity, bug.title ); } continue; } let Some(max_version) = all_versions.iter().max().map(|v| (*v).clone()) else { error!( "Skipping {}: package has no binaries in the archive", source ); continue; }; let architectures = source_info .iter() .filter_map(|(architecture, version)| { if version != &max_version { Some(*architecture) } else { None } }) .collect(); sources_architectures.push((source, max_version, architectures)); } Ok(sources_architectures) } } #[async_trait] impl Command for NMUVersionSkew<'_> { async fn run(&self) -> Result<()> { let suite = self.options.suite.into(); let sources = self.load_version_skew(suite)?; for (source, version, architectures) in sources { let mut source = SourceSpecifier::new(&source); source.with_suite(self.options.suite); source.with_archive_architectures(architectures.as_ref()); let version_without_binnmu = version.clone().without_binnmu_version(); source.with_version(&version_without_binnmu); let mut binnmu = BinNMU::new(&source, "Rebuild to sync binNMU versions")?; binnmu.with_build_priority(self.options.build_priority); binnmu.with_nmu_version(version.binnmu_version().unwrap()); let command = binnmu.build(); println!("{}", command); if !self.base_options.dry_run { command.execute()?; } } Ok(()) } fn downloads(&self) -> Vec { vec![CacheEntries::FTBFSBugs(self.options.suite.into())] } fn required_downloads(&self) -> Vec { vec![CacheEntries::Packages(self.options.suite.into())] } } drt-tools-0.2.20/src/process_excuses.rs000064400000000000000000000207501046102023000162120ustar 00000000000000// Copyright 2021-2023 Sebastian Ramacher // SPDX-License-Identifier: GPL-3.0-or-later use std::cmp::min; use anyhow::Result; use assorted_debian_utils::{ architectures::Architecture, archive::{Component, Suite}, excuses::{self, ExcusesItem, PolicyInfo, Verdict}, wb::{BinNMU, SourceSpecifier, WBArchitecture, WBCommand, WBCommandBuilder}, }; use async_trait::async_trait; use clap::Parser; use indicatif::{ProgressBar, ProgressIterator}; use log::{debug, error, info, trace, warn}; use serde::{Deserialize, Serialize}; use crate::{ config::{self, default_progress_template, CacheEntries}, source_packages::SourcePackages, BaseOptions, Command, }; const SCHEDULED_BINNMUS: &str = "scheduled-binnmus.yaml"; #[derive(Debug, Default, Serialize, Deserialize)] struct ScheduledBinNMUs { binnmus: Vec, } impl ScheduledBinNMUs { fn contains(&self, command: &WBCommand) -> bool { self.binnmus.contains(command) } fn store(&mut self, command: &WBCommand) { self.binnmus.push(command.clone()) } } #[derive(Debug, Parser)] pub(crate) struct ProcessExcusesOptions { /// Do not prepare binNMUs to allow testing migration #[clap(long)] no_rebuilds: bool, } pub(crate) struct ProcessExcuses<'a> { cache: &'a config::Cache, base_options: &'a BaseOptions, options: ProcessExcusesOptions, } impl<'a> ProcessExcuses<'a> { pub(crate) fn new( cache: &'a config::Cache, base_options: &'a BaseOptions, options: ProcessExcusesOptions, ) -> Self { Self { cache, base_options, options, } } fn is_binnmu_required(policy_info: &PolicyInfo) -> bool { if let Some(b) = &policy_info.builtonbuildd { if b.verdict == Verdict::Pass { // nothing to do trace!("no binmu required: passing"); return false; } if b.verdict == Verdict::RejectedCannotDetermineIfPermanent { // missing builds trace!("no binnmu possible: missing builds"); return false; } } if let Some(a) = &policy_info.age { if a.current_age < min(a.age_requirement / 2, a.age_requirement - 1) { // too young trace!( "no binnmu possible: too young: {} days (required: {} days)", a.current_age, a.age_requirement ); return false; } } // if the others do not pass, would not migrate even if binNMUed policy_info.extras.values().all(|info| { if info.verdict != Verdict::Pass { trace!("no binnmu possible: verdict not passing: {:?}", info); false } else { true } }) } fn build_binnmu(item: &ExcusesItem, source_packages: &SourcePackages) -> Option { if !Self::is_actionable(item) { debug!("{}: not actionable", item.source); return None; } let Some(ref policy_info) = item.policy_info else { return None; }; if !Self::is_binnmu_required(policy_info) { debug!("{}: binNMU not required", item.source); return None; } // find architectures with maintainer built binaries let mut archs = vec![]; for (arch, signer) in policy_info.builtonbuildd.as_ref().unwrap().signed_by.iter() { if let Some(signer) = signer { if !signer.ends_with("@buildd.debian.org") { if arch == &Architecture::All { // cannot binNMU arch: all debug!("{}: cannot binNMU arch: all", item.source); return None; } archs.push(WBArchitecture::Architecture(*arch)); } } } if archs.is_empty() { // this should not happen, but just to be on the safe side warn!( "{}: considered candidate, but no architecture with missing build", item.source ); trace!("{:?}", item); return None; } let mut source_specifier = SourceSpecifier::new(&item.source); source_specifier.with_version(item.new_version.as_ref().unwrap()); if !source_packages.is_ma_same(&item.source) { source_specifier.with_architectures(&archs); } match BinNMU::new(&source_specifier, "Rebuild on buildd") { Ok(command) => Some(command.build()), // not binNMU-able Err(_) => { error!("{}: failed to construct nmu command", item.source); None } } } fn is_actionable(item: &ExcusesItem) -> bool { if item.is_removal() { // skip removals trace!("{} not actionable: removal", item.source); return false; } if item.is_binnmu() { // skip binNMUs trace!("{} not actionable: binNMU", item.source); return false; } if item.is_from_pu() { // skip PU requests trace!("{} not actionable: pu request", item.source); return false; } if item.is_from_tpu() { // skip TPU requests trace!("{} not actionable: tpu request", item.source); return false; } match item.component { Some(Component::Main) | None => {} _ => { // skip non-free and contrib trace!("{} not actionable: in {:?}", item.source, item.component); return false; } } if let Some(true) = item.invalidated_by_other_package { // skip otherwise blocked packages trace!("{} not actionable: invalided by other package", item.source); return false; } if item.missing_builds.is_some() { // skip packages with missing builds trace!("{} not actionable: missing builds", item.source); return false; } true } fn load_scheduled_binnmus(&self) -> ScheduledBinNMUs { if let Ok(reader) = self.cache.get_data_bufreader(SCHEDULED_BINNMUS) { serde_yaml::from_reader(reader).unwrap_or_default() } else { Default::default() } } fn store_scheduled_binnmus(&self, scheduled_binnmus: ScheduledBinNMUs) -> Result<()> { serde_yaml::to_writer( self.cache.get_data_bufwriter(SCHEDULED_BINNMUS)?, &scheduled_binnmus, ) .map_err(|err| err.into()) } } #[async_trait] impl Command for ProcessExcuses<'_> { async fn run(&self) -> Result<()> { let source_packages = SourcePackages::new(&self.cache.get_package_paths(Suite::Unstable, false)?)?; // parse excuses let excuses = excuses::from_reader(self.cache.get_cache_bufreader("excuses.yaml")?)?; // now process the excuses let pb = ProgressBar::new(excuses.sources.len() as u64); pb.set_style(config::default_progress_style().template(default_progress_template())?); pb.set_message("Processing excuses"); let to_binnmu: Vec = excuses .sources .iter() .progress_with(pb) .filter_map(|item| Self::build_binnmu(item, &source_packages)) .collect(); // load already scheduled binNMUs from cache let mut scheduled_binnmus = self.load_scheduled_binnmus(); if !self.options.no_rebuilds { println!("# Rebuild on buildds for testing migration"); for binnmu in to_binnmu { if scheduled_binnmus.contains(&binnmu) { info!("{}: skipping, already scheduled", binnmu); } else { println!("{}", binnmu); if !self.base_options.dry_run { binnmu.execute()?; scheduled_binnmus.store(&binnmu); } } } } // store scheduled binNMUs in cache self.store_scheduled_binnmus(scheduled_binnmus) } fn required_downloads(&self) -> Vec { vec![CacheEntries::Excuses] } fn downloads(&self) -> Vec { vec![CacheEntries::Packages(Suite::Unstable)] } } drt-tools-0.2.20/src/process_unblocks.rs000064400000000000000000000072131046102023000163520ustar 00000000000000// Copyright 2021-2023 Sebastian Ramacher // SPDX-License-Identifier: GPL-3.0-or-later use anyhow::Result; use assorted_debian_utils::excuses::{self, ExcusesItem, Verdict}; use async_trait::async_trait; use indicatif::{ProgressBar, ProgressIterator}; use log::{debug, error, trace}; use crate::{ config::{self, default_progress_template, CacheEntries}, Command, }; pub(crate) struct ProcessUnblocks<'a> { cache: &'a config::Cache, } impl<'a> ProcessUnblocks<'a> { pub(crate) fn new(cache: &'a config::Cache) -> Self { Self { cache } } fn build_unblock(item: &ExcusesItem) -> Option { if !Self::is_actionable(item) { debug!("{}: not actionable", item.source); return None; } let mut unblock = String::from("unblock "); unblock.push_str(&item.source); // append _tpu if item is from _tpu if item.is_from_tpu() { unblock.push_str("_tpu"); } // append version unblock.push('/'); match item.new_version { Some(ref version) => unblock.push_str(&version.to_string()), _ => { // this will never happen error!("{}: new-version not set", item.source); return None; } }; // append architecture for binNMUs if item.is_binnmu() { unblock.push('/'); match item.binnmu_arch() { Some(arch) => unblock.push_str(arch.as_ref()), None => { // this will never happen error!("{}: binNMU but unable to extract architecture", item.source); return None; } }; } Some(unblock) } fn is_actionable(item: &ExcusesItem) -> bool { if item.is_removal() { // skip removals trace!("{} not actionable: removal", item.source); return false; } if item.is_from_pu() { // skip pu trace!("{} not actionable: pu request", item.source); return false; } if !item.is_from_tpu() && !item.is_binnmu() { // skip non-tpu requests trace!("{} not actionable: not in tpu or not binnmu", item.source); return false; } if let Some(true) = item.invalidated_by_other_package { // skip otherwise blocked packages trace!("{} not actionable: invalided by other package", item.source); return false; } if item.migration_policy_verdict != Verdict::RejectedNeedsApproval { // skip packages not requiring approval trace!("{}: not actionable: does not need approval", item.source); return false; } true } } #[async_trait] impl Command for ProcessUnblocks<'_> { async fn run(&self) -> Result<()> { // parse excuses let excuses = excuses::from_reader(self.cache.get_cache_bufreader("excuses.yaml")?)?; // now process the excuses let pb = ProgressBar::new(excuses.sources.len() as u64); pb.set_style(config::default_progress_style().template(default_progress_template())?); pb.set_message("Processing excuses"); let unblocks: Vec<_> = excuses .sources .iter() .progress_with(pb) .filter_map(Self::build_unblock) .collect(); println!("# Unblocks"); for unblock in unblocks { println!("{}", unblock); } Ok(()) } fn downloads(&self) -> Vec { [CacheEntries::Excuses].into() } } drt-tools-0.2.20/src/source_packages.rs000064400000000000000000000044331046102023000161330ustar 00000000000000// Copyright 2021-2022 Sebastian Ramacher // SPDX-License-Identifier: GPL-3.0-or-later use std::collections::HashSet; use std::path::Path; use anyhow::Result; use assorted_debian_utils::{archive::MultiArch, rfc822_like}; use indicatif::{ProgressBar, ProgressIterator}; use serde::Deserialize; use crate::config; #[derive(Deserialize, Debug, Eq, PartialEq)] #[serde(rename_all = "PascalCase")] struct BinaryPackage { source: Option, package: String, #[serde(rename = "Multi-Arch")] multi_arch: Option, } pub struct SourcePackages { ma_same_sources: HashSet, } impl SourcePackages { pub fn new

(paths: &[P]) -> Result where P: AsRef, { let mut ma_same_sources = HashSet::::new(); for path in paths { let sources = Self::parse_packages(path); ma_same_sources.extend(sources?); } Ok(Self { ma_same_sources }) } fn parse_packages

(path: P) -> Result> where P: AsRef, { // read Package file let binary_packages: Vec = rfc822_like::from_file(path.as_ref())?; let pb = ProgressBar::new(binary_packages.len() as u64); pb.set_style(config::default_progress_style().template( "{msg}: {spinner:.green} [{wide_bar:.cyan/blue}] {pos}/{len} ({per_sec}, {eta})", )?); pb.set_message(format!( "Processing {}", path.as_ref().file_name().unwrap().to_str().unwrap() )); // collect all sources with MA: same binaries let ma_same_sources: HashSet = binary_packages .into_iter() .progress_with(pb) .filter(|binary_package| binary_package.multi_arch == Some(MultiArch::Same)) .map(|binary_package| { if let Some(source_package) = &binary_package.source { source_package.split_whitespace().next().unwrap().into() } else { // no Source set, so Source == Package binary_package.package } }) .collect(); Ok(ma_same_sources) } pub fn is_ma_same(&self, source: &str) -> bool { self.ma_same_sources.contains(source) } } drt-tools-0.2.20/src/udd_bugs.rs000064400000000000000000000067471046102023000146030ustar 00000000000000use std::{ collections::HashMap, fmt::{Display, Formatter}, io::Read, }; use anyhow::Result; use serde::Deserialize; #[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq, PartialOrd, Ord)] #[serde(rename_all = "lowercase")] pub enum Severity { Wishlist, Normal, Important, Serious, Grave, Critical, } impl AsRef for Severity { fn as_ref(&self) -> &str { match self { Severity::Wishlist => "wishlist", Severity::Normal => "normal", Severity::Important => "important", Severity::Serious => "serious", Severity::Grave => "grave", Severity::Critical => "critical", } } } /* impl Severity { fn is_rc(&self) -> bool { self >= &Severity::Serious } } */ impl Display for Severity { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.as_ref()) } } #[derive(Clone, Debug, Deserialize)] pub struct UDDBug { pub id: u32, pub source: String, pub severity: Severity, pub title: String, } #[derive(Debug, Default)] pub struct UDDBugs { bugs: Vec, source_index: HashMap>, } impl UDDBugs { pub fn new(bugs: Vec) -> Self { let mut udd_bugs = Self { bugs, ..Default::default() }; for (idx, bug) in udd_bugs.bugs.iter().enumerate() { udd_bugs .source_index .entry(bug.source.clone()) .or_default() .push(idx); } udd_bugs } pub fn bugs_for_source(&self, source: &str) -> Option> { self.source_index .get(source) .map(|indices| indices.iter().map(|idx| &self.bugs[*idx]).collect()) } } pub fn load_bugs_from_reader(reader: impl Read) -> Result { serde_yaml::from_reader(reader) .map_err(|e| e.into()) .map(UDDBugs::new) } #[cfg(test)] mod test { use super::{load_bugs_from_reader, Severity}; const TEST_DATA: &str = r#" --- - id: 743062 package: src:mutextrace source: mutextrace severity: serious title: 'mutextrace: sometimes FTBFS: testsuite races' last_modified: '2021-08-16' status: pending affects_stable: false affects_testing: false affects_unstable: true affects_experimental: false last_modified_full: '2021-08-16 07:03:39 +0000' autormdate: '' - id: 778111 package: src:scheme2c source: scheme2c severity: serious title: 'scheme2c: ftbfs with GCC-5' last_modified: '2021-08-16' status: pending affects_stable: false affects_testing: false affects_unstable: true affects_experimental: false last_modified_full: '2021-08-16 07:03:46 +0000' autormdate: '' - id: 789292 package: src:dmtcp source: dmtcp severity: serious title: 'dmtcp: FTBFS with glibc-2.21 and gcc-5' last_modified: '2021-11-16' status: forwarded affects_stable: false affects_testing: false affects_unstable: true affects_experimental: false last_modified_full: '2021-11-16 23:03:16 +0000' autormdate: '' "#; #[test] fn read_bugs() { let bugs = load_bugs_from_reader(TEST_DATA.as_bytes()).unwrap(); assert!(bugs.bugs_for_source("dmtcp").is_some()); assert!(bugs.bugs_for_source("zathura").is_none()); for bug in bugs.bugs_for_source("mutextrace").unwrap() { assert!(bug.severity >= Severity::Serious); // assert!(bug.severity.is_rc()); } } } drt-tools-0.2.20/src/usrmerged.rs000064400000000000000000000313321046102023000147700ustar 00000000000000// Copyright 2022-2023 Sebastian Ramacher // SPDX-License-Identifier: GPL-3.0-or-later use std::collections::{HashMap, HashSet}; use std::fs::File; use std::io::{BufRead, BufReader}; use std::iter::FusedIterator; use std::path::PathBuf; use anyhow::Result; use assorted_debian_utils::architectures::Architecture; use assorted_debian_utils::archive::Suite; use async_trait::async_trait; use clap::Parser; use log::{debug, info, trace, warn}; use smallvec::SmallVec; use crate::config::{self, CacheEntries}; use crate::Command; type SmallString = smartstring::alias::String; const SKIP: [&str; 6] = [ "boot/", "etc/", "lib/modules/", "usr/src/", "usr/share/doc", "var/", ]; fn strip_section(package: &str) -> SmallString { package.split_once('/').map_or(package, |(_, p)| p).into() } fn compute_path_to_test_impl(path: &str) -> SmallString { if let Some(stripped) = path.strip_prefix("usr/") { stripped.into() } else { format!("usr/{}", path).into() } } fn compute_path_to_test(path: impl AsRef) -> SmallString { compute_path_to_test_impl(path.as_ref()) } #[derive(Debug, Parser)] pub(crate) struct UsrMergedOptions { /// Also include files that only moved between / and /usr but stayed in the same package #[clap(long)] include_moved_in_package: bool, /// Do not skip some paths known to not be affected #[clap(long)] no_skip: bool, } pub(crate) struct UsrMerged<'a> { cache: &'a config::Cache, options: UsrMergedOptions, } struct LoadIterator { reader: BufReader, suite: Suite, arch: Architecture, no_skip: bool, } impl Iterator for LoadIterator { // if there is a file in more than one package, the most common case are two packages type Item = (SmallString, SmallVec<[SmallString; 2]>); fn next(&mut self) -> Option { let mut line = String::new(); while let Ok(size) = self.reader.read_line({ line.clear(); &mut line }) { if size == 0 { // reached EOF return None; } let line = line .strip_suffix("\r\n") .or(line.strip_suffix('\n')) .unwrap_or(&line); trace!("{}/{}: processing: {}", self.suite, self.arch, line); let mut split = line.split_whitespace(); let (path, packages) = match (split.next(), split.next()) { (Some(path), Some(packages)) => (path, packages), _ => { warn!("Unable to process line: {}", line); continue; } }; // skip some well-known locations which should not be an issue: boot/, usr/etc/, usr/lib/modules/, ... if !self.no_skip && SKIP.into_iter().any(|prefix| path.starts_with(prefix)) { debug!("Skipping '{}'", path); continue; } return Some(( path.into(), packages.split(',').map(strip_section).collect(), )); } // Error None } } impl FusedIterator for LoadIterator {} fn load_contents_iter( suite: Suite, arch: Architecture, path: PathBuf, no_skip: bool, ) -> Result { debug!("Processing contents for {} on {}: {:?}", suite, arch, path); let reader = BufReader::new(File::open(path)?); Ok(LoadIterator { reader, suite, arch, no_skip, }) } impl<'a> UsrMerged<'a> { pub(crate) fn new(cache: &'a config::Cache, options: UsrMergedOptions) -> Self { Self { cache, options } } fn load_contents_iter(&self, suite: Suite, arch: Architecture) -> Result { for (architecture, path) in self.cache.get_content_paths(suite)? { if architecture != arch { continue; } return load_contents_iter(suite, arch, path, self.options.no_skip); } unreachable!("This will never be reached."); } fn load_contents( &self, suite: Suite, arch: Architecture, ) -> Result>> { for (architecture, path) in self.cache.get_content_paths(suite)? { if architecture != arch { continue; } return Ok(HashMap::from_iter(load_contents_iter( suite, arch, path, self.options.no_skip, )?)); } unreachable!("This will never be reached."); } } #[async_trait] impl Command for UsrMerged<'_> { async fn run(&self) -> Result<()> { let release_architectures = self.cache.architectures_for_suite(Suite::Testing(None)); let stable_architectures = self.cache.architectures_for_suite(Suite::Stable(None)); // only consider release architectures that are also in stable let release_architectures: Vec<_> = release_architectures .into_iter() .filter(|arch| stable_architectures.contains(arch)) .collect(); // Check if file from stable on $architecture moved to other // packages on testing on $architecture | all. If architecture == // all, this will check all -> all. let mut testing_all_file_map = self.load_contents(Suite::Testing(None), Architecture::All)?; for architecture in release_architectures.iter().copied() { let testing_file_map = if architecture != Architecture::All { self.load_contents(Suite::Testing(None), architecture)? } else { HashMap::new() }; for (path, stable_packages) in self.load_contents_iter(Suite::Stable(None), architecture)? { let path_to_test = compute_path_to_test(&path); debug!( "{}: processing {} - checking for {}", architecture, path, path_to_test ); let testing_packages_set = match ( testing_file_map.get(&path_to_test), testing_all_file_map.get(&path_to_test), ) { (None, None) => { debug!("{}: {} not found", architecture, path_to_test); continue; } (None, Some(packages)) | (Some(packages), None) => { HashSet::from_iter(packages.iter().map(|v| v.as_str())) } (Some(arch_packages), Some(all_packages)) => HashSet::from_iter( arch_packages .iter() .chain(all_packages.iter()) .map(|v| v.as_str()), ), }; let testing_packages_set_original_path = match (testing_file_map.get(&path), testing_all_file_map.get(&path)) { (None, None) => { debug!("{}: {} not found", architecture, path_to_test); HashSet::new() } (None, Some(packages)) | (Some(packages), None) => { HashSet::from_iter(packages.iter().map(|v| v.as_str())) } (Some(arch_packages), Some(all_packages)) => HashSet::from_iter( arch_packages .iter() .chain(all_packages.iter()) .map(|v| v.as_str()), ), }; let stable_packages_set: HashSet<&str> = HashSet::from_iter(stable_packages.iter().map(|v| v.as_str())); if stable_packages_set != testing_packages_set { if stable_packages_set == testing_packages_set_original_path { println!( "also-in-other-package: {}: {} {:?} vs {} {:?}", architecture, path, stable_packages_set, path_to_test, testing_packages_set, ); } else { println!( "moved: {}: {} => {}: {:?} vs {:?}", architecture, path, path_to_test, stable_packages_set, testing_packages_set, ); } } else if self.options.include_moved_in_package { println!( "moved-in-package: {}: {} => {}: {:?}", architecture, path, path_to_test, stable_packages_set, ); } else { info!( "Renamed {} to {} (packages {:?})", path, path_to_test, testing_packages_set, ); } } } testing_all_file_map.clear(); // Check if file from stable on all moved to other // packages on testing on $architecture for all architectures except all. for testing_architecture in release_architectures .into_iter() .filter(|arch| *arch != Architecture::All) { let testing_file_map = self.load_contents(Suite::Testing(None), testing_architecture)?; for (path, stable_packages) in self.load_contents_iter(Suite::Stable(None), Architecture::All)? { let path_to_test = compute_path_to_test(&path); debug!( "{} -> {}: processing {} - checking for {}", Architecture::All, testing_architecture, path, path_to_test ); let testing_packages_set = match testing_file_map.get(path_to_test.as_str()) { None => { debug!("{}: {} not found", Architecture::All, path_to_test); continue; } Some(packages) => HashSet::from_iter(packages.iter().map(|v| v.as_str())), }; let testing_packages_set_original_path = match testing_file_map.get(path.as_str()) { None => { debug!("{}: {} not found", Architecture::All, path_to_test); continue; } Some(packages) => HashSet::from_iter(packages.iter().map(|v| v.as_str())), }; let stable_packages_set: HashSet<&str> = HashSet::from_iter(stable_packages.iter().map(|v| v.as_str())); if stable_packages_set != testing_packages_set { if stable_packages_set == testing_packages_set_original_path { println!( "also-in-other-package: {}: {} {:?} vs {} {:?}", Architecture::All, path, stable_packages_set, path_to_test, testing_packages_set, ); } else { println!( "moved: {} -> {}: {} => {}: {:?} vs {:?}", Architecture::All, testing_architecture, path, path_to_test, stable_packages_set, testing_packages_set, ); } } else if self.options.include_moved_in_package { println!( "moved-in-package: {} -> {}: {} => {}: {:?}", Architecture::All, testing_architecture, path, path_to_test, stable_packages_set, ); } else { info!( "Renamed {} to {} (packages {:?})", path, path_to_test, testing_packages_set, ); } } } Ok(()) } fn downloads(&self) -> Vec { [ CacheEntries::Contents(Suite::Stable(None)), CacheEntries::Contents(Suite::Testing(None)), ] .into() } }