summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-09-27 15:40:26 +0000
committerZac Medico <zmedico@gentoo.org>2007-09-27 15:40:26 +0000
commit9db2b6a19b2a1e8a381a3b8c5b9bdab1868c0d02 (patch)
tree06febd24a2302ab927011b06246476df00e4a72a
parent73eb89c4515fc1bdc6f1b86bcad82aad0d03904d (diff)
downloadportage-9db2b6a19b2a1e8a381a3b8c5b9bdab1868c0d02.tar.gz
portage-9db2b6a19b2a1e8a381a3b8c5b9bdab1868c0d02.tar.bz2
portage-9db2b6a19b2a1e8a381a3b8c5b9bdab1868c0d02.zip
Bug #193486 - Use xargs to avoid 'bash: /bin/rm: Argument list too long'
errors. This patch uses a weird tr '\001' '\000' workaround since bash doesn't echo null bytes like one might expect. svn path=/main/trunk/; revision=7848
-rwxr-xr-xbin/ecompress3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/ecompress b/bin/ecompress
index bf886e1c4..676929d44 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -67,7 +67,8 @@ case $1 in
# delete it so that the compressor doesn't whine (bzip2 will
# complain and skip, gzip will prompt for input)
suffix=$(ecompress --suffix)
- [[ -n ${suffix} ]] && rm -f "${@/%/${suffix}}"
+ [[ -n ${suffix} ]] && echo ${@/%/${suffix}$'\001'} | \
+ tr '\001' '\000' | ${XARGS} -0 rm -f
# Finally, let's actually do some real work
exec "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} "$@"
;;