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

Attached to Project: Pacman
Opened by Andrew Barchuk (raindev) - Sunday, 20 August 2017, 12:12 GMT
Last edited by Allan McRae (Allan) - Wednesday, 13 September 2017, 03:26 GMT
Task Type Bug Report
Category Scripts & Tools
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 5.0.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

checkupdates do not set error exit status when updates can't be fetched. When pacman -Sy command fails, its result is ignored and the script exits with status code of 0. Would be nice to let the user know when updates can't be fetched vs when no updates are available. Attached a diff with a possible fix.


Additional info:

$ pacman -Q pacman
pacman 5.0.2-2


Example:

$ checkupdates
$ echo $?
0
$ ping -c4 example.com
ping: example.com: Name or service not known
This task depends upon

Closed by  Allan McRae (Allan)
Wednesday, 13 September 2017, 03:26 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in pacman-contrib project
Comment by Eli Schwartz (eschwartz) - Sunday, 20 August 2017, 14:41 GMT
  • Field changed: Attached to Project (Arch Linux → Pacman)
  • Field changed: Summary ([pacman] checkupdates sets wrong exit status when network is down → [pacman-contrib] checkupdates sets wrong exit status when network is down)
Not 100% positive where this bug should go since it's a pacman issue not a packaging issue... but contrib was moved to a separate repo. Assuming the pacman project for now...

You're going to want to send that to the pacman-contrib mailing list BTW: https://lists.archlinux.org/listinfo/pacman-contrib
Comment by Andrew Barchuk (raindev) - Sunday, 20 August 2017, 18:35 GMT

Loading...