summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorDario Giovannetti <dariogiova@gmail.com>2015-01-02 17:11:04 +0100
committerAllan McRae <allan@archlinux.org>2015-01-11 09:57:19 +0100
commite8d757b6ba9ca545266c43279cfef1a48971c013 (patch)
tree9acb1bdedf1db4c4e02562d1904fc3453ee71cd6 /contrib
parentfb9db2df5d1188b87f5763e4681f7f6d1b7ff988 (diff)
downloadpacman-e8d757b6ba9ca545266c43279cfef1a48971c013.tar.gz
pacman-e8d757b6ba9ca545266c43279cfef1a48971c013.tar.xz
paccache: exit in case of pacman error when -u flag is used
Fixes https://bugs.archlinux.org/task/43286 Signed-off-by: Dario Giovannetti <dariogiova@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/paccache.sh.in2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/paccache.sh.in b/contrib/paccache.sh.in
index 6a68d4de..1690583e 100644
--- a/contrib/paccache.sh.in
+++ b/contrib/paccache.sh.in
@@ -256,6 +256,8 @@ while :; do
delete=1 ;;
-u|--uninstalled)
IFS=$'\n' read -r -d '' -a ign < <(pacman -Qq)
+ # pacman -Qq may exit with an error, thus making ign an empty array
+ (( ${#ign[@]} )) || die 'failed to retrieve the list of installed packages'
blacklist+=("${ign[@]}")
unset ign ;;
-V|--version)