Bug 286510 - pkgbase: make update-packages regressed after base be61deae0aa2
Summary: pkgbase: make update-packages regressed after base be61deae0aa2
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 15.0-CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-pkg (Nobody)
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2025-05-01 19:38 UTC by Evgenii Khramtsov
Modified: 2025-05-05 17:34 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Evgenii Khramtsov 2025-05-01 19:38:04 UTC
I see the following after base be61deae0aa2 in make update-packages output:

[...]
FreeBSD-zoneinfo-pkg -o ABI=FreeBSD:15:amd64 -o ALLOW_BASE_SHLIBS=yes  -o OSVERSION="1500039"  create -f tzst -l 3  -M /usr/obj/usr/src/amd64.amd64/worldstage/zoneinfo.ucl  -p /usr/obj/usr/src/amd64.amd64/worldstage/zoneinfo.plist  -r /usr/obj/usr/src/amd64.amd64/worldstage  -o /usr/obj/usr/src/repo/FreeBSD:15:amd64/15.snap20250501192157
pkg: invalid option -- o
[...]
==> Keeping old FreeBSD-hostapd-dbg-15.snap20250501111230.pkg
pkg: invalid option -- F
[...]

I reverted base be61deae0aa2, did make && make install inside usr.sbin/pkg, then the messages disappeared. Please either chase be61deae0aa2 in pkgbase build glue or adjust be61deae0aa2 for it.
Comment 1 rkoberman 2025-05-03 22:13:33 UTC
This problem is in hte revised parsing of the command line. It appears to nr reflect any functional change, but does result in a bogus error message for each option on the command line that is not processed by the base option of pkg. In other words, any command processed by a sub-command such as version or info,

While the options are reported as invalid, they are passed to the subcommand and properly executed.

A workaround is to alias "pkg" to "/usr/local/sbin/pkg", but this is clearly not ideal.
# pkg version -vL=
pkg: invalid option -- v
pkg: invalid option -- L
pkg: invalid option -- =
libreoffice-25.2.2.2_1             <   needs updating (index has 25.2.3.2)
# alias pkg /usr/local/sbin/pkg
# pkg version -vL=
libreoffice-25.2.2.2_1             <   needs updating (index has 25.2.3.2)
Comment 2 Isaac Freund 2025-05-05 08:05:36 UTC
https://reviews.freebsd.org/D50163 should fix this, I simply forgot a ':'.
Comment 3 commit-hook freebsd_committer freebsd_triage 2025-05-05 15:52:37 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=73ba568b1c35aabc1682540b5b4d5d77220c5468

commit 73ba568b1c35aabc1682540b5b4d5d77220c5468
Author:     Isaac Freund <ifreund@freebsdfoundation.org>
AuthorDate: 2025-05-05 08:03:08 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-05-05 15:52:08 +0000

    pkg: suppress error on unknown options

    pkg(7) does not understand all the options that pkg(8) understands and
    should never log errors about unknown options that it will pass on to
    pkg(8) without touching.

    PR:             286510
    Reviewed by:    bapt
    Fixes:          be61deae0aa2 ("pkg: clarify argument parsing")
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D50163

 usr.sbin/pkg/pkg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)