From e8d757b6ba9ca545266c43279cfef1a48971c013 Mon Sep 17 00:00:00 2001 From: Dario Giovannetti Date: Sat, 3 Jan 2015 00:11:04 +0800 Subject: paccache: exit in case of pacman error when -u flag is used Fixes https://bugs.archlinux.org/task/43286 Signed-off-by: Dario Giovannetti Signed-off-by: Allan McRae --- contrib/paccache.sh.in | 2 ++ 1 file changed, 2 insertions(+) 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) -- cgit v1.2.3-70-g09d2