dev/list-rdeps: prompt to update if apt is too old
Ximin Luo
4 years ago
7 | 7 | |
8 | 8 | pkg="${1//_/-}" |
9 | 9 | pkg="${pkg#rust-}" |
10 | ||
11 | if [ $(($(date +%s) - $(stat -c %Y /var/cache/apt/pkgcache.bin))) -gt 7200 ]; then | |
12 | read -p "APT cache is a bit old, update? [Y/n] " x | |
13 | if [ "$x" != "n" ]; then sudo apt update; fi | |
14 | fi | |
10 | 15 | |
11 | 16 | echo "Version in unstable:" |
12 | 17 | aptitude versions --disable-columns -F '%p' --group-by=none "~e^rust-${pkg}$ ~rnative ~Aunstable" |