Allow error in apt calls since those are handled by the script
Javier Fernandez-Sanguino
11 years ago
40 | 40 | esac |
41 | 41 | |
42 | 42 | # First check if apt-get is sane enough before proceeding |
43 | set +e | |
43 | 44 | apt-get -q2 --print-uris --reinstall install "dpkg" 2>/dev/null >/dev/null |
44 | 45 | if [ $? -ne 0 ] ; then |
45 | 46 | echo "ERROR: There was an error calling apt-get. Check that the database is in a consistent state and try again" |
49 | 50 | echo "ERROR: Your apt lists are empty. Update your package database" |
50 | 51 | echo "using 'apt-get update'" |
51 | 52 | fi |
53 | set -e | |
52 | 54 | |
53 | 55 | |
54 | 56 | for pkgspec in $*; do |
57 | set +e | |
55 | 58 | apt-get -q2 --print-uris --reinstall install "$pkgspec" 2>/dev/null >/dev/null |
56 | 59 | if [ $? -ne 0 ] ; then |
57 | 60 | echo "ERROR: There is no '$pkgspec' package. Sorry." |
59 | 62 | echo "package database using 'apt-get update'" |
60 | 63 | continue |
61 | 64 | fi |
65 | set -e | |
62 | 66 | # This provides only one version, but it's better than the apt-get |
63 | 67 | # call which will not work in packages not available locally |
64 | 68 | apt-cache show "$pkgspec" 2>/dev/null | grep ^Ver | |