[pacman-contrib] checkupdates sets wrong exit status when network is down

Andrew Barchuk andrew at raindev.io
Sun Aug 20 18:32:53 UTC 2017


Greetings,

I've discovered that checkupdates script ignores failures to fetch
package updates silently and exits with 0. Basically result of pacman
-Sy is not handled. Obviously it would be good to let the user know
whether there're no package updates or it's not possible to check.

I've opened an issue on Arch Linux bug tracker:
https://bugs.archlinux.org/task/55206

Here's a possible diff to fix the problem:

$ diff pacman-5.0.2/contrib/checkupdates.sh.in ~/checkupdates.sh.in 
54c54,57
< fakeroot -- pacman -Sy --dbpath "$CHECKUPDATES_DB" --logfile /dev/null
&> /dev/null
---
> if ! fakeroot -- pacman -Sy --dbpath "$CHECKUPDATES_DB" --logfile /dev/null &> /dev/null; then
> 	error 'Cannot fetch updates'
> 	exit 1
> fi

Thanks!

---
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp.sig
Type: application/pgp-signature
Size: 566 bytes
Desc: not available
URL: <https://lists.archlinux.org/pipermail/pacman-contrib/attachments/20170820/2c16dec8/attachment.sig>


More information about the pacman-contrib mailing list