void-docs icon indicating copy to clipboard operation
void-docs copied to clipboard

src/xbps/index.md: Mention `xpkg` to list installed packages

Open camoz opened this issue 2 years ago • 7 comments

Reasons for mentioning this:

  • using xpkg is much simpler: one command without arguments vs. 3 commands piped together
  • xpkg is much faster: 0.13 s versus 3.28 s (on a C2D laptop with SSD from 2011)

camoz avatar Dec 27 '21 04:12 camoz

I forgot to mention, I have 255 packages installed on this test system, and it's in a VM.

[root@void ~]# time xpkg > /dev/null

real	0m0.130s
user	0m0.080s
sys	0m0.046s
[root@void ~]# time xbps-query -l | awk '{ print $2 }' | xargs -n1 xbps-uhelper getpkgname > /dev/null

real	0m3.280s
user	0m1.637s
sys	0m1.583s

camoz avatar Dec 27 '21 04:12 camoz

Hm, maybe it would be better to mention xpkg for a package list w/o version, and plain xbps-query -l for a package list with version.

camoz avatar Dec 27 '21 04:12 camoz

xpkg isn't part of the base system and is provided by a separate set of tools.

abenson avatar Dec 27 '21 04:12 abenson

Yes, but there are many places in the docs that refer to using a tool from xtools. Even on the same page it's mentioned already two times.

FWIW I'm in favor of my second idea:

Hm, maybe it would be better to mention xpkg for a package list w/o version, and plain xbps-query -l for a package list with version.

camoz avatar Dec 27 '21 07:12 camoz

xpkg isn't part of the base system and is provided by a separate set of tools.

I agree with this partly, but I think that it might be worth offering a simple command from xtools as an alternative to a long shell command people are going to just copy and paste.

bobertlo avatar Dec 27 '21 13:12 bobertlo

I think ideally xbps would support printing the package names natively, like pacman (and probably many other package managers):

# pacman -Q
a52dec 0.7.4-11
abcde 2.9.3-5
...
# pacman -Qq
a52dec
abcde
...

Even the first version would be enough, one could a do more simple | cut -d' ' -f1 then.

camoz avatar Dec 27 '21 14:12 camoz

I would be in favor of mentioning this, but I think we should reverse the order - first the long command using only packages from base, then a shorter alternative - the xpkg script from xtools.

paper42 avatar Mar 01 '22 18:03 paper42