debcargo-conf/dev/list-remaining-deps.sh
Ian Jackson 87c0930c70 Make scripts all be #!/bin/bash
sh is rather inconvenient.  I am about to introduce a bashism in
vars.sh.frag and various others.
2021-09-03 11:47:40 +01:00

32 lines
909 B
Bash
Executable File

#!/bin/bash
abort() { local x=$1; shift; for i in "$@"; do echo >&2 "$0: abort: $i"; done; exit "$x"; }
echo >&2 "Note, this script is not very accurate and may print out redundant stuff,"
echo >&2 "e.g. dependencies of crates that we already patched away in Debian."
if [ -n "$DEBCARGO" ]; then
true
elif which debcargo >/dev/null; then
DEBCARGO=$(which debcargo)
elif [ -f "$HOME/.cargo/bin/debcargo" ]; then
DEBCARGO="$HOME/.cargo/bin/debcargo"
else
abort 1 "debcargo not found, run \`cargo install debcargo\` or set DEBCARGO to point to it"
fi
if [ -d ../debcargo ]; then
DEBCARGO_SRC=../debcargo
else
abort 1 "debcargo.git not found, set DEBCARGO_SRC and try again"
fi
export DEBCARGO
for c in "$@"; do \
"$DEBCARGO_SRC"/tests/sh/cargo-tree-deb-rec "$c"; done \
| sed -e 's/ v/ /g' \
| dev/filter-semver.sh \
| awk '!x[$0]++' \
| dev/filter-crate-in-debian.sh \
| sed -nre 's/(.*) 0$/\1/gp'