Skip to content

pacman: Fix script failure for no updates #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rossmeier
Copy link

When no updates are available, checkupdates fails with exit code 2. Catch this by wrapping the command using || true.

When no updates are available, checkupdates and pacman -Qu fail.
Catch this by wrapping the command using || true.

Signed-off-by: Justus Rossmeier <[email protected]>
@@ -14,10 +14,10 @@ set -o pipefail

if [ -x /usr/bin/checkupdates ]
then
updates=$(/usr/bin/checkupdates | wc -l)
updates=$( (checkupdates || true) | wc -l)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|| true ignores all failures. As-is it would even pick another checkupdates executable if found in $PATH. Isn't there a specific exit code? If need be the output can also be checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants