paru
paru copied to clipboard
`paru -Qu` returns `1` when there are no packages to update
Affected Version
paru v1.11.1 - libalpm v13.0.1
Description
The return value of paru -Qu when no packages are available for update has changed.
It returned 0 a few versions ago, but now it's returning 1.
This makes it harder to use on scripts. (Are there no updates or has it failed because there is no internet? Maybe it crashed?)
I suggest returning to the old behaviour or return 2 like checkupdates does since v1.2.0.
Output
> paru -Qu
<no packages>
> echo $?
1
> paru -Qua
<no packages>
> echo $?
1
> paru -Qua
<some packages>
> echo $?
0
> checkupdates
<some packages>
> echo $?
0
> checkupdates
<no packages>
> echo $?
2
Paru has always returned 1 for -Qu or at least should have. This won't change.
It's returned 1 since at least 952b541d97c9 (June 18 2021), which is the earliest commit I can build on my machine