summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-03-16 23:38:47 +0000
committerMike Frysinger <vapier@gentoo.org>2007-03-16 23:38:47 +0000
commite4f268b67960ff7326d69fe150cc648c2593e0ab (patch)
tree7d0e0057b5d8e4e28220b523a42e9fbe0c73a5e6
parenta407af83f510c1206373623ab84695eb8139f8a1 (diff)
downloadportage-e4f268b67960ff7326d69fe150cc648c2593e0ab.tar.gz
portage-e4f268b67960ff7326d69fe150cc648c2593e0ab.tar.bz2
portage-e4f268b67960ff7326d69fe150cc648c2593e0ab.zip
drop the need for the force flag by default and just delete the existing files automatically #171007
svn path=/main/trunk/; revision=6219
-rwxr-xr-xbin/ecompress8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/ecompress b/bin/ecompress
index 2006f657b..7e51e3c44 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