Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#76614 - [pacman] undocumented output to standard error - or - optional dependencies not saved to pacman.log

Attached to Project: Arch Linux
Opened by James (thx1138) - Friday, 18 November 2022, 03:33 GMT
Last edited by Toolybird (Toolybird) - Friday, 18 November 2022, 05:47 GMT
Task Type General Gripe
Category Packages: Core
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

pacman 6.0.2-5

$ pacman -Q pacman notInstlledPackage
pacman 6.0.2-5
error: package 'notInstalledPackage' was not found

$ pacman -Q notInstalledPackage | grep error
error: package 'notInstalledPackage' was not found

$ pacman -Q pacman notInstalledPackage | grep error | sed "s/[^']*'\([^']*\)'[^']*/\1/"
error: package 'notInstalledPackage' was not found

!!!

pacman errors are output to standard error, not to standard output, AND, this behavior is not documented. "grepping" for packages which are not installed will produce an empty list unless, for instance, in bash, "2>&1" is explicitly specified.

Maybe there is some other way to identify from a list, packages which have not been installed - specifically, those packages which are listed as optional dependencies to installed packages? Notably, "expac" does not disclose whether an optional dependency has, or has not, been installed.

So, documenting this unexpected use of standard error by pacman would be courteous and helpful.

This issue might not otherwise be a problem, except that "When installing a package, pacman will list a package's optional dependencies, but they will not be found in pacman.log."

This task depends upon

Closed by  Toolybird (Toolybird)
Friday, 18 November 2022, 05:47 GMT
Reason for closing:  None
Additional comments about closing:  See comments
Comment by Doug Newgard (Scimmia) - Friday, 18 November 2022, 03:47 GMT
See pacman -T

How in the world do you figure that errors being in stderr would be unexpected? It's literally part of the name.
Comment by James (thx1138) - Friday, 18 November 2022, 04:53 GMT
Simply, a query for a "not installed package" is *not* an "error", in that sense. How in the world do you figure that a not installed package query is a stderr type of error? It is not an error from the "pacman" program itself.

The manpage for "pacman -T" says "return a list of dependencies that are not currently satisfied on the system", but this does *not* include optional dependencies. For instance, try "pacman -T tesseract". The tesseract package has many optional dependencies, but nothing will be shown.
Comment by Toolybird (Toolybird) - Friday, 18 November 2022, 05:47 GMT
@thx1138 the first part of your gripe, to be quite blunt, is rather silly. Outputting errors to stderr is just standard Unix.

The 2nd part is just a scripting exercise. Combining I/O redirection, exit status, and output from either `expac' or `pacman -Qi ...' will get you what you want. Please take any further discussion to the proper support channels (forum/IRC/etc).

Loading...