summaryrefslogtreecommitdiffstats
path: root/contrib/paccache.sh.in
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2013-05-29 06:02:56 +0200
committerAllan McRae <allan@archlinux.org>2013-05-29 06:02:56 +0200
commit84ac55b0529b6489da38ebfc56a988228aa4859a (patch)
tree66667e127a6509af1b701bf2077d023e55b04f44 /contrib/paccache.sh.in
parent0f988beff8794338485352dc1beafbfcdbb20db1 (diff)
parent7d2c7fb347e8b5ea89127f3f8b4a545772394600 (diff)
downloadpacman-84ac55b0529b6489da38ebfc56a988228aa4859a.tar.gz
pacman-84ac55b0529b6489da38ebfc56a988228aa4859a.tar.xz
Merge branch 'maint'
Diffstat (limited to 'contrib/paccache.sh.in')
-rw-r--r--contrib/paccache.sh.in7
1 files changed, 3 insertions, 4 deletions
diff --git a/contrib/paccache.sh.in b/contrib/paccache.sh.in
index 64c3c536..a9c6524f 100644
--- a/contrib/paccache.sh.in
+++ b/contrib/paccache.sh.in
@@ -109,8 +109,7 @@ runcmd() {
if sudo -v &>/dev/null && sudo -l &>/dev/null; then
sudo "$@"
else
- printf '%s ' 'root'
- su -c "$(printf '%q ' "$@")"
+ die 'Unable to escalate privileges using sudo'
fi
else
"$@"
@@ -308,9 +307,9 @@ totalsaved=$(@SIZECMD@ "${candidates[@]}" | awk '{ sum += $1 } END { print sum }
# crush. kill. destroy.
(( verbose )) && cmdopts+=(-v)
if (( delete )); then
- runcmd xargs -0a <(printf '%s\0' "${candidates[@]}") rm "${cmdopts[@]}"
+ printf '%s\0' "${candidates[@]}" | runcmd xargs -0 rm "${cmdopts[@]}"
elif (( move )); then
- runcmd xargs -0a <(printf '%s\0' "${candidates[@]}") mv "${cmdopts[@]}" -t "$movedir"
+ printf '%s\0' "${candidates[@]}" | runcmd xargs -0 mv "${cmdopts[@]}" -t "$movedir"
fi
summarize "$pkgcount" "${candidates[@]}"