summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-03-04 19:50:07 +0000
committerMike Frysinger <vapier@gentoo.org>2007-03-04 19:50:07 +0000
commit7a7f0435e441c88ab1632d3ba23a6e970683e32a (patch)
treeb7cb123175ca23ef2c9ddaf961ed758d9f650e3a
parente13a7002efcc76474d4342da985114afe96e4979 (diff)
downloadportage-7a7f0435e441c88ab1632d3ba23a6e970683e32a.tar.gz
portage-7a7f0435e441c88ab1632d3ba23a6e970683e32a.tar.bz2
portage-7a7f0435e441c88ab1632d3ba23a6e970683e32a.zip
allow people to disable compression by setting the PORTAGE_COMPRESS variables to ""
svn path=/main/trunk/; revision=6174
-rwxr-xr-xbin/ecompress12
-rwxr-xr-xbin/ecompressdir14
2 files changed, 12 insertions, 14 deletions
diff --git a/bin/ecompress b/bin/ecompress
index 2b2fa814d..2006f657b 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -3,16 +3,18 @@
# Distributed under the terms of the GNU General Public License v2
# $Id: prepman 5507 2007-01-10 04:22:27Z zmedico $
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
if [[ -z $1 ]] ; then
- echo "${0##*/}: at least one argument needed" 1>&2
+ vecho "${0##*/}: at least one argument needed" 1>&2
exit 1
fi
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-
# setup compression stuff
-PORTAGE_COMPRESS=${PORTAGE_COMPRESS:-bzip2}
-if [[ -z ${PORTAGE_COMPRESS_FLAGS} ]] ; then
+PORTAGE_COMPRESS=${PORTAGE_COMPRESS-bzip2}
+[[ -z ${PORTAGE_COMPRESS} ]] && exit 0
+
+if [[ ${PORTAGE_COMPRESS_FLAGS+set} != "set" ]] ; then
case ${PORTAGE_COMPRESS} in
bzip2|gzip) PORTAGE_COMPRESS_FLAGS="-f9";;
esac
diff --git a/bin/ecompressdir b/bin/ecompressdir
index 163230dda..cad0ce26c 100755
--- a/bin/ecompressdir
+++ b/bin/ecompressdir
@@ -3,19 +3,15 @@
# Distributed under the terms of the GNU General Public License v2
# $Id: prepalldocs 3483 2006-06-10 21:40:40Z genone $
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
if [[ -z $1 ]] ; then
- echo "${0##*/}: at least one argument needed" 1>&2
+ vecho "${0##*/}: at least one argument needed" 1>&2
exit 1
fi
# figure out the new suffix
suffix=$(ecompress --suffix)
-if [[ -z ${suffix} ]] ; then
- vecho "${0##*/}: unable to figure out compressed suffix"
- exit 1
-fi
-
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
# funk_up_dir(action, suffix, binary)
# - action: compress or decompress
@@ -54,8 +50,6 @@ for dir in "$@" ; do
if [[ ! -d ${dir} ]] ; then
vecho "${0##*/}: ${dir#${D}} does not exist!"
continue
- else
- vecho "${0##*/}: $(ecompress --bin) ${dir#${D}}"
fi
# not uncommon for packages to compress doc files themselves
@@ -64,6 +58,8 @@ for dir in "$@" ; do
funk_up_dir "decompress" "bz2" "bunzip2"
# now lets do our work
+ [[ -z ${suffix} ]] && continue
+ vecho "${0##*/}: $(ecompress --bin) ${dir#${D}}"
funk_up_dir "compress" "${suffix}" "ecompress"
done