Skip to content
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

"auracle outdated" exit code ambiguous #89

Closed
karabaja4 opened this issue Jun 13, 2021 · 1 comment
Closed

"auracle outdated" exit code ambiguous #89

karabaja4 opened this issue Jun 13, 2021 · 1 comment

Comments

@karabaja4
Copy link

karabaja4 commented Jun 13, 2021

Hello,

auracle has exit code 1 in both these situations:

No updates available:

~ >> auracle outdated
~ >> echo $?
1

Internet connection down:

~ >> auracle outdated
error: UNKNOWN: Could not resolve host: aur.archlinux.org
~ >> echo $?
1

This makes it hard to call auracle from scripts because it's impossible to differentiate between success/failure of fetching the number of upgradable packages without parsing stderr.

I would expect auracle to return 0 (success) if the connection to AUR is successfully established and no packages are upgradable,
or return some error code other than 1 if there was a connection issue to differentiate this from a "no updates available" exit code.

Regards,

Igor

@falconindy
Copy link
Owner

IMO, it's perfectly fine that it's ambiguous. There's absolute consistency in a non-zero exit status indicating that no upgradable packages were able to be found, regardless of the reason. A zero exit status indicates with certainty that packages are available. This is a nice feature.

You should never need to query the AUR for upgrades such that you: a) have complex logic to retry failures based on an exit status, b) can't wait for the external condition to resolve itself some minutes/hours/days later. I do not want to commit to exit statuses as API.

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

No branches or pull requests

2 participants