Bug 264690 - ports-mgmt/pkg: pkg info -e only returns (in exit code) status for last package listed
Summary: ports-mgmt/pkg: pkg info -e only returns (in exit code) status for last packa...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-pkg (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-15 13:38 UTC by Peter Eriksson
Modified: 2024-01-02 20:16 UTC (History)
3 users (show)

See Also:
linimon: maintainer-feedback? (pkg)


Attachments
Patch to only return EXIT_SUCCESS if all pkgs listed are found (472 bytes, patch)
2023-08-03 22:04 UTC, Peter Eriksson
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Eriksson 2022-06-15 13:38:55 UTC
I little bit annoying, it seems "pkg info -e" only returns as the exit status for the last package listed even though it checks all. A workaround is to just use "pkg info" and redirect stdout to /dev/null...


# pkg info tmux zstd && echo OK
tmux-3.2a
zstd-1.5.2
OK

# pkg info tmux zstd not-found && echo OK
tmux-3.2a
zstd-1.5.2
pkg: No package(s) matching not-found

# pkg info tmux not-found zstd && echo OK
tmux-3.2a
pkg: No package(s) matching not-found
zstd-1.5.2

# pkg info -e tmux not-found zstd && echo OK
pkg: No package(s) matching not-found
OK

# pkg info -e tmux zstd not-found && echo OK
pkg: No package(s) matching not-found
Comment 1 Peter Eriksson 2023-08-03 21:34:48 UTC
Still the same behavior in FreeBSD 13.2...
Comment 2 Peter Eriksson 2023-08-03 22:04:51 UTC
Created attachment 243828 [details]
Patch to only return EXIT_SUCCESS if all pkgs listed are found

Attached is a small patch that fixes "pkg info -e pkg1 .. pkgN" so that it returns EXIT_SUCCESS only if all packages are found, instead of just returning the state of the last package...
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2024-01-02 20:16:59 UTC
^Triage: trim Cc: list.