Skip to content

Print an error message when a package isn't found when using -Si - #2718

Merged
Jguer merged 1 commit into
Jguer:nextfrom
jdholtz:info-print-error-no-pkg
Dec 21, 2025
Merged

Print an error message when a package isn't found when using -Si#2718
Jguer merged 1 commit into
Jguer:nextfrom
jdholtz:info-print-error-no-pkg

Conversation

@jdholtz

@jdholtz jdholtz commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

This fixes the second issue discussed in #2472. It uses the same solution to find missing packages as in #2717, so if both of these get merged, I can create a common function to not duplicate this logic.

A couple of notes on how yay -Si <pkg> differs from pacman -Si <pkg> (not huge deals IMO):

  1. The exit code from yay is 1 when a package isn't found, whereas with pacman the exit code is the number of packages not found (mod 256)
  2. pacman prints all packages in order of being specified, including errors. E.g specifying cmatrix, nonexistent, firefox will show the cmatrix info, then 'error: package 'nonexistent' not found, then firefox info. Yay will print all packages not found first, then repo packages, then AUR packages due to the way the implementation is structured.

Both of these are not big deals, but wanted to point them out in case. I did not update/add any tests as this is just for error printing, but can do so if that is desired.

@jdholtz
jdholtz requested a review from Jguer as a code owner December 2, 2025 04:33
@Jguer

Jguer commented Dec 21, 2025

Copy link
Copy Markdown
Owner

I'm ok with it but there's a bunch of users that run CI environments and want yay to ignore all types of errors in missing packages. I think since this doesn't change the missing logic, we should be ok.
Merging it in and we'll see based on feedback

@Jguer
Jguer merged commit 74e3cf8 into Jguer:next Dec 21, 2025
2 checks passed
@jdholtz
jdholtz deleted the info-print-error-no-pkg branch December 21, 2025 15:04
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