Skip to content

Conversation

@jdholtz
Copy link
Contributor

@jdholtz jdholtz commented Dec 1, 2025

Fixes #1744 and #2696. Adds support for printing AUR packages with --print and --print-format. When printing AUR packages, local packages are differentiated from remote packages as local packages have all info that pacman prints, whereas remote packages don't (for example, there isn't a sha256sum as there is no pre-built package). For all remote packages, any formats specified that aren't supported are just removed with an empty string.

A couple notes on how this differentiates from how pacman does print formatting:

  1. The ordering is different. Pacman will print all targets specified first, and then upgrades (if the user requests). In this PR, yay would print all local AUR packages and then all remote AUR packages. I don't think this is a big deal, but if we want to match the ordering exactly, it would complicate the code a lot with the current implementation
  2. Every local AUR package prints the install size when the user specifies %s, whereas pacman prints the download size. This is done because the download size is 0 for all AUR packages. As pacman already handles printing with the -R and -U ops, it is only a mismatch for -S.

Happy to discuss different approaches to handle these mismatches if desired. I also added some tests to make sure the correct code paths are entered when specifying upgrades, only AUR pkgs, only repo pkgs, and a mix of both.

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.

Passing --print-format argument results in yay exiting with 'target-not-found' error

1 participant