summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-03-27 20:53:25 +0000
committerZac Medico <zmedico@gentoo.org>2007-03-27 20:53:25 +0000
commit7d69df08fb5da46078e6ce3354633d1785040a06 (patch)
tree7226170902f893dc4253d39e68b53719771f7961 /bin/ecompress
parentsend stdout to /dev/null since we rely on the output of stdout here to determ... (diff)
downloadportage-multirepo-7d69df08fb5da46078e6ce3354633d1785040a06.tar.gz
portage-multirepo-7d69df08fb5da46078e6ce3354633d1785040a06.tar.bz2
portage-multirepo-7d69df08fb5da46078e6ce3354633d1785040a06.zip
drop the need for the force flag by default and just delete the existing files automatically #171007 (trunk r6218:6219)
svn path=/main/branches/2.1.2/; revision=6295
Diffstat (limited to 'bin/ecompress')
-rwxr-xr-xbin/ecompress8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/ecompress b/bin/ecompress
index 59e1e869..5e4f6457 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -16,7 +16,7 @@ PORTAGE_COMPRESS=${PORTAGE_COMPRESS-bzip2}
if [[ ${PORTAGE_COMPRESS_FLAGS+set} != "set" ]] ; then
case ${PORTAGE_COMPRESS} in
- bzip2|gzip) PORTAGE_COMPRESS_FLAGS="-f9";;
+ bzip2|gzip) PORTAGE_COMPRESS_FLAGS="-9";;
esac
fi
@@ -41,6 +41,12 @@ case $1 in
echo "${PORTAGE_COMPRESS} ${PORTAGE_COMPRESS_FLAGS}"
;;
*)
+ # If a compressed version of the file already exists, simply
+ # 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}}"
+ # Finally, let's actually do some real work
exec "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} "$@"
;;
esac