[Bug 284538] ports-mgmt/pkg: The option '-o' in command version

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 01 Jul 2025 12:30:37 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284538

Eric <erichanskrs@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |erichanskrs@gmail.com

--- Comment #1 from Eric <erichanskrs@gmail.com> ---
(In reply to Paolo from comment #0)

It seems that using the package name (not using -o) and using the package
origin (using -o) are using different output formatting code paths. At least
they exibit different behaviour wrt seperating the first output column from the
following limchar.

QUOTE
I have a script that formats the result of command above and stop working for
ports longer than the padding space.
END_QUOTE

A work-around using sed(1) (extend the used character class if needed) may
help:
[0-0] # pkg -v; date -u
2.2.1
Tue Jul  1 12:11:11 UTC 2025
[1-0] # pkg version -o -l '=' -n lsof | sed 's/[<=>]$/ &/'
sysutils/lsof                      =
[2-0] # pkg version -o -l '=' -n
rubygem-opentelemetry-instrumentation-active_model_serializers | sed 's/[<=>]$/
&/'
devel/rubygem-opentelemetry-instrumentation-active_model_serializers =


This should not harm processing when the error has been resolved.


P.S.
As far as I can tell pkg v. 2.1.4, using -o, also had the formatting output
problem.

-- 
You are receiving this mail because:
You are the assignee for the bug.