Also detect if apt-get returns with non-error value but fails to provide URIs
Javier Fernandez-Sanguino
8 years ago
253 | 253 | if [ -z "$aptdata" ] |
254 | 254 | then |
255 | 255 | errormsg "There was an error looking for package '$package'." |
256 | apt-get -q2 --print-uris --reinstall install "dpkg" 2>&1 >/dev/null | |
257 | if [ $? -eq 0 ] ; then | |
256 | aptdata=`apt-get -q2 --print-uris --reinstall install "apt-get" 2>/dev/null | grep "apt-get"_` | |
257 | if [ $? -ne 0 ] || [ -z "$aptdata" ] ; then | |
258 | # If looking for apt-get fails then there is something amiss | |
259 | error "Apt-get might not be working properly Possible failure when running 'apt-get -q2 --print-uris --reinstall install \"$package\"'" | |
260 | else | |
258 | 261 | error "The package does not exist." |
259 | else | |
260 | error "Apt-get might not be working properly Possible failure when running 'apt-get -q2 --print-uris --reinstall install \"$package\"'" | |
261 | 262 | fi |
262 | 263 | # Note: We do not get here, error() exits before |
263 | 264 | exit 1 |