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

-Qi, -Si, -Qc, -Qg, -Qk, -Ql not printing exit status in case of an error #2472

Open
drws opened this issue Jul 14, 2024 · 0 comments
Open

Comments

@drws
Copy link

drws commented Jul 14, 2024

Affected Version

yay v12.3.5 - libalpm v14.0.0

Describe the bug

At least -Qi, -Si, -Qc, -Qg, -Qk and -Ql operations aren't printing exit status in case of an error as do other ones (-Sl for example). In addition, yay -Si is failing to pass Pacman's error message.

Reproduction Steps

An expected output for reference:

$ yay -Sl nonexistent
error: repository "nonexistent" was not found.
 -> exit status 1

The issue:

$ yay -Si nonexistent
$ yay -Qi nonexistent
error: package 'nonexistent' was not found
$ yay -Qc nonexistent
error: package 'nonexistent' was not found
$ yay -Qg nonexistent
error: group 'nonexistent' was not found
$ yay -Qk nonexistent
error: package 'nonexistent' was not found
$ yay -Ql nonexistent
error: package 'nonexistent' was not found

As seen above there is no exit status printed with listed operations even though an error occurs and all the exit codes are 1.

In what is basically a separate, but a very related issue, already seen in the output above - yay -Si is also failing to pass Pacman's error message:

$ pacman -Si nonexistent
error: package 'nonexistent' was not found

Skipping the error message can also be observed with yay -Sg while that one seems to be a separate issue (in Pacman):

$ pacman -Sg nonexistent
$ yay -Sg nonexistent
 -> exit status 1

Expected behavior

  • Exit status line ( -> exit status 1) to be printed in all cases where applicable. There might be other operations affected by the issue. One would expect that this part of the code is shared for all operations and that the status line is printed anytime the status code is non-zero, but I didn't look into it.
  • yay -Si to pass Pacman's error messages. This additional issue might also be present in other places, a more generalized solution for passing these might be desired too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant