diff options
author | Lars Wirzenius <liw@sequoia-pgp.org> | 2022-07-30 17:39:37 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@sequoia-pgp.org> | 2022-07-30 20:19:48 +0300 |
commit | c75c5f5b415fb27d969997caa333df921c85f04d (patch) | |
tree | ced6c4d9fd95aba73047ed30e3a7fda10d12e5c9 | |
parent | 678c408b1a911a2a452ea31624ef595649b4acf7 (diff) | |
download | missing-dependencies-c75c5f5b415fb27d969997caa333df921c85f04d.tar.gz |
feat: add scripts to list Debian packages and Rust dependencies
Sponsored-by: author
-rw-r--r-- | README.md | 6 | ||||
-rwxr-xr-x | debian-crate-packages | 18 |
2 files changed, 19 insertions, 5 deletions
@@ -12,9 +12,6 @@ There are three parts: * `debian-crate-packages` is a simple shell script that fetches the package list for the Debian "unstable" version, and produces a list of Rust crates and versions that have been packaged. -* `rust-dependencies` is a shell script that reads the output of - `cargo tree` (possibly with options like `--all-features`) and - produces a list of crates and versions. * The Rust program in this crate reads the outputs of the two scripts and produces a list of missing crates or versions. @@ -34,8 +31,7 @@ about dependencies: ```sh $ ./debian-crate-packages > crates-in-debian -$ (cd /where/rust/program/is && cargo tree) | ./rust-dependencies > crates-wanted -$ cargo run -q -- crates-in-debian crates-wanted +$ (cd /where/rust/program/is && cargo tree) | cargo run -q -- crates-in-debian missing-version aho-corasick 0.7.18 missing-entirely ansi_term ``` diff --git a/debian-crate-packages b/debian-crate-packages new file mode 100755 index 0000000..c4c8a5a --- /dev/null +++ b/debian-crate-packages @@ -0,0 +1,18 @@ +#!/bin/bash + +set -euo pipefail + +if [ ! -e Packages ]; then + curl -s http://deb.debian.org/debian/dists/unstable/main/binary-amd64/Packages.xz | + unxz >Packages +fi +grep-dctrl -s Package,Version librust- Packages | + awk ' +/^Package:/ { + name = $2 + gsub(/^librust-/, "", name) + gsub(/-dev$/, "", name) + gsub(/-/, "_", name) +} +/^Version:/ { gsub(/-[^-]*$/, "", $2); print name, $2 } +' |