mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 15:58:50 -05:00
paccache: use xargs to execute mv/rm commands
This removes the restriction on the length of the command line, as xargs will work around by running multiple instances of the command for us. As seen: https://bbs.archlinux.org/viewtopic.php?pid=1232959 Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
34749e177d
commit
972528c021
@ -310,9 +310,9 @@ totalsaved=$(@SIZECMD@ "${candidates[@]}" | awk '{ sum += $1 } END { print sum }
|
|||||||
# crush. kill. destroy.
|
# crush. kill. destroy.
|
||||||
(( verbose )) && cmdopts+=(-v)
|
(( verbose )) && cmdopts+=(-v)
|
||||||
if (( delete )); then
|
if (( delete )); then
|
||||||
runcmd rm "${cmdopts[@]}" "${candidates[@]}"
|
printf '%s\0' "${candidates[@]}" | runcmd xargs -0 rm "${cmdopts[@]}"
|
||||||
elif (( move )); then
|
elif (( move )); then
|
||||||
runcmd mv "${cmdopts[@]}" "${candidates[@]}" "$movedir"
|
printf '%s\0' "${candidates[@]}" | runcmd xargs -0 mv "${cmdopts[@]}" -t "$movedir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
summarize "$pkgcount" "${candidates[@]}"
|
summarize "$pkgcount" "${candidates[@]}"
|
||||||
|
Loading…
Reference in New Issue
Block a user