Codebase list rust-stfu8 / 7284c60
list-rdeps: run for several packages at once, generalise wording Ximin Luo 4 years ago
1 changed file(s) with 34 addition(s) and 28 deletion(s). Raw diff Collapse all Expand all
66 which grep-dctrl >/dev/null || abort 1 "grep-dctrl not found, install dctrl-tools"
77 which aptitude >/dev/null || abort 1 "aptitude not found, install it"
88
9 pkg="${1//_/-}"
10 pkg="${pkg#rust-}"
9 ARCHIVE="${ARCHIVE:-unstable}"
1110
1211 if [ $(($(date +%s) - $(stat -c %Y /var/cache/apt/pkgcache.bin))) -gt 7200 ]; then
1312 read -p "APT cache is a bit old, update? [Y/n] " x
1413 if [ "$x" != "n" ]; then sudo apt update; fi
1514 fi
1615
17 ARCHIVE="${ARCHIVE:-unstable}"
1816 apt_versions() {
1917 aptitude versions --disable-columns -F '%p %t' --group-by=none "~rnative $1" | grep "$ARCHIVE"
2018 }
2725 fi
2826 }
2927
30 echo "Versions of rust-${pkg} in $ARCHIVE:"
31 apt_versions "~e^rust-${pkg}$" | sort | while read binpkg ver archive; do
32 stat="$(installability "$binpkg" "$ver")"
33 printf "%s %-48s %-16s\n" "$stat" "$binpkg" "$ver"
34 done
35 echo
28 list_rdeps() {
29 pkg="${1//_/-}"
30 pkg="${pkg#rust-}"
3631
37 echo "Versions of rdeps in $ARCHIVE:"
38 apt_versions "~D^librust-${pkg}~(\+~|-[0-9]~).*-dev$" | while read rdep ver archives; do
39 apt-cache show "${rdep}=${ver}" \
40 | grep-dctrl -FDepends -e "librust-${pkg}(\+|-[0-9]).*-dev" -sPackage,Version,Depends - \
41 | cut -d: -f2 | cut '-d ' -f2- \
42 | sed -z -e 's/\n\n/\t/g' -e 's/\n/ /g' -e 's/\t/\n/g'
43 done | sort | while read rdep ver deps; do
44 rustdeps="$(printf "%s" "$deps" | tr ',' '\n' | egrep -wo "librust-${pkg}(\+|-[0-9])\S*-dev" | tr '\n' ' ')"
45 stat="$(installability "$rdep" "$ver")"
46 printf "%s %-48s %-16s depends on %s\n" "$stat" "$rdep" "$ver" "$rustdeps"
47 done
48 echo
32 echo "Versions of rust-${pkg} in $ARCHIVE:"
33 apt_versions "~e^rust-${pkg}$" | sort | while read binpkg ver archive; do
34 local stat="$(installability "$binpkg" "$ver")"
35 printf "%s %-48s %-16s\n" "$stat" "$binpkg" "$ver"
36 done
37 echo
38
39 echo "Versions of rdeps of rust-${pkg} in $ARCHIVE:"
40 apt_versions "~D^librust-${pkg}~(\+~|-[0-9]~).*-dev$" | while read rdep ver archives; do
41 apt-cache show "${rdep}=${ver}" \
42 | grep-dctrl -FDepends -e "librust-${pkg}(\+|-[0-9]).*-dev" -sPackage,Version,Depends - \
43 | cut -d: -f2 | cut '-d ' -f2- \
44 | sed -z -e 's/\n\n/\t/g' -e 's/\n/ /g' -e 's/\t/\n/g'
45 done | sort | while read rdep ver deps; do
46 local rustdeps="$(printf "%s" "$deps" | tr ',' '\n' | egrep -wo "librust-${pkg}(\+|-[0-9])\S*-dev" | tr '\n' ' ')"
47 local stat="$(installability "$rdep" "$ver")"
48 printf "%s %-48s %-16s depends on %s\n" "$stat" "$rdep" "$ver" "$rustdeps"
49 done
50 echo
51 }
52
53 for i in "$@"; do list_rdeps "$i"; done
4954
5055 cat <<eof
5156 If any package is marked "X" (to the left of the package) it means it is not
5257 installable even in $ARCHIVE - you should check why this is so by attempting to
5358 install it yourself, e.g. via aptitude, and see why it can't be installed. This
5459 must be fixed before migration is attempted. For example, it may depend on a
55 package which is not yet in Debian.
60 package which is not yet in Debian. Make sure you give the \`-t $ARCHIVE\` flag
61 so it chooses packages from the correct archive.
5662
57 One common reason, for an rdep, is that its dependency (on rust-${pkg}) is out
58 of date - check the "depends" column above to see if this is the case. If so,
59 you must upgrade it to the current version, by patching Cargo.toml to accept
60 the new version of ${pkg} as a dependency. Of course, check that the build
61 works - if it doesn't, then you'll need to further patch the source code of the
62 rdep to use the API of the new version of ${pkg}.
63 One common reason, for an rdep, is that its dependency is out of date - check
64 the "depends" column above to see if this is the case. If so, you must upgrade
65 it to the current version, by patching Cargo.toml to accept the new version of
66 the dependency. Of course, check that the build works - if it doesn't, then
67 you'll need to further patch the source code of the rdep to use the API of the
68 new version of the dependency.
6369
6470 Alternatively, if any rdep is obsolete (i.e. nothing else depends on it) then
6571 you should file a RM request to remove it from the Debian archive. See the