freebsd / pkg

Package management tool for FreeBSD. Help at #pkg on Libera Chat or pkg@FreeBSD.org
Other
738 stars 277 forks source link

pkg info `-E` is ignored in combination with `-O` #2194

Open lonkamikaze opened 8 months ago

lonkamikaze commented 8 months ago

E.g.:

# pkg info -EO math/\*                                                                                                                                                                                               AprilRyan.norad:~/ 0 
Imath-3.1.9                    C++/Python lib of 2D/3D vector, matrix, math ops for computer graphics
MathJax3-3.2.2                 Cross-browser JavaScript display engine for mathematics
fast_float-5.2.0               Fast and exact C++ number parsing library
fftw3-3.3.10_4                 Fast C routines to compute the Discrete Fourier Transform
fftw3-float-3.3.10_4           Fast Discrete Fourier Transform (Single Precision C Routines)
glpk-5.0                       GNU Linear Programming Kit
gmp-6.3.0                      Free library for arbitrary precision arithmetic
gsl-2.7.1                      The GNU Scientific Library - mathematical libs
lp_solve-5.5.2.5               Linear Programming Solver
mpc-1.3.1_1                    Library of complex numbers with arbitrarily high precision
mpdecimal-2.5.1                C/C++ arbitrary precision decimal floating point libraries
mpfr-4.2.1,1                   Library for multiple-precision floating-point computations
qhull-8.0.2_2,1                Qhull computes convex hulls, Delaunay triangulations, and halfspaces
sc-7.16_3                      Curses-based spreadsheet program

Expected:

# pkg info -EO math/\*                                                                                                                                                                                               Imath-3.1.9
MathJax3-3.2.2
fast_float-5.2.0
fftw3-3.3.10_4
fftw3-float-3.3.10_4
glpk-5.0
gmp-6.3.0
gsl-2.7.1
lp_solve-5.5.2.5
mpc-1.3.1_1
mpdecimal-2.5.1
mpfr-4.2.1,1
qhull-8.0.2_2,1
sc-7.16_3
lonkamikaze commented 8 months ago

The same is true for -aE. I get the expected output with -aq and -Oq. The man page is extremely vague about -q and it doesn't seem to do what I want for all cases.

bapt commented 8 months ago

-E has been added for a compatibility with pkg_* so has not been wide spreaded and consistently implemented, if you want a full control on the output of pkg, I will strongly recommend that you use pkg query:

pkg query -g "%n-%v" "math/*"

lonkamikaze commented 8 months ago

AFAIK pkg query does not support -O.

bapt commented 8 months ago

It does not need, if you are looking that origins, the above example works