From 1ca58984bf9f7df1ee216a9bbb841b91b30eb7b6 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sat, 28 Jul 2018 17:19:30 -0500 Subject: [PATCH] [debian] Exclude packages with dpkg state 'deinstall' from installed list When listing packages already installed (e.g. for use with `apt remove ...`), do not consider packages return by `dpkg --get-selections` with state 'deinstall'. Previously the `string replace` pattern was matching both 'install' and 'deinstall' packages. --- share/functions/__fish_print_packages.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/functions/__fish_print_packages.fish b/share/functions/__fish_print_packages.fish index 6ff33a6ee..2b9bdf944 100644 --- a/share/functions/__fish_print_packages.fish +++ b/share/functions/__fish_print_packages.fish @@ -21,7 +21,7 @@ function __fish_print_packages if type -q -f apt-cache if set -q only_installed - dpkg --get-selections | string replace -r '(\S+).*' "\$1\t$package" + dpkg --get-selections | string replace -fr '(\S+)\s+install' "\$1\t$package" return else # Do not generate the cache as apparently sometimes this is slow.