paru icon indicating copy to clipboard operation
paru copied to clipboard

`paru -Qu` returns `1` when there are no packages to update

Open unai-ndz opened this issue 3 years ago • 1 comments

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

unai-ndz avatar Sep 08 '22 10:09 unai-ndz

Paru has always returned 1 for -Qu or at least should have. This won't change.

Morganamilo avatar Sep 08 '22 10:09 Morganamilo

It's returned 1 since at least 952b541d97c9 (June 18 2021), which is the earliest commit I can build on my machine

typecasto avatar Oct 10 '22 02:10 typecasto