icy / pacapt

An ArchLinux's pacman-like shell wrapper for many package managers. 56KB and run anywhere.
Other
958 stars 69 forks source link

No --quiet mode #143

Closed crabdancing closed 3 years ago

crabdancing commented 4 years ago

If I do pacman -R $(pacman -Qsq | grep potato) I can uninstall all potato related packages in one go, on an Arch Linux system. On Ubuntu, using pacapt, I cannot. This seems to me to be a big piece of missing functionality.

icy commented 4 years ago

If I do pacman -R $(pacman -Qsq | grep potato) I can uninstall all potato related packages in one go, on an Arch Linux system. On Ubuntu, using pacapt, I cannot. This seems to me to be a big piece of missing functionality.

Does pacman -Qq work for you?

icy commented 4 years ago

On my current Arch, these are the same

$ diff <(pacman -Qq) <(pacman -Qqs)
# no diff

I suspect you're looking for -s option, which is supposed to be an alias of pacman -Qq. But I'm not sure...

crabdancing commented 4 years ago

The -s option does not fix my problem, unfortunately.

The -s option means search. -s is behaving the same in that situation because you don't have any search term. Also, note that you're putting -q on both, which means both outputs will be quiet. If you try having one with -Qs and the other with -Qq, you will see a marked difference.

To see easier what -s does: if you add a search term, you'll see the difference -- one option looks for the exact package name:

$ pacman -Qq linux
linux

And the other one turns up anything matching a regex search term in the package's description, or package name:

$ pacman -Qqs linux
alsa-lib
alsa-utils
an2linuxserver-git
android-udev
apparmor
arch-install-scripts
archiso
. . .

As far as I am aware, an external search is the only robust workaround, if you just want to search package names:

$ pacman -Qsq | grep linux
an2linuxserver-git
archlinux-java-run
archlinux-keyring
lib32-util-linux
libutil-linux
linux
linux-api-headers
linux-firmware
linux-headers
linux-lts
linux-lts-headers
syslinux
util-linux

A package list is easily generatable for all these use cases, with pacman, by passing -q. So that should be the case for pacapt too.

Anyway, hope that helps clear it up!

icy commented 4 years ago

Thanks a lot, @alxpettit . I think we need to add another option (-q) to this one https://github.com/icy/pacapt/blob/0ef1133fc34a34a0099514106f4a9cb6019732fc/lib/dpkg.sh#L73 .

icy commented 3 years ago

Fixed in https://github.com/icy/pacapt/pull/154