summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-06-30 01:03:44 -0700
committerZac Medico <zmedico@gentoo.org>2011-06-30 01:03:44 -0700
commita4336dd925767f1a78d7d046110fd7462f676d8d (patch)
treea5480eec82597a0dcebb37820c6363dc4990342c
parent86f285fe9c94e2a817de077eda7e8744130c412f (diff)
downloadportage-a4336dd925767f1a78d7d046110fd7462f676d8d.tar.gz
portage-a4336dd925767f1a78d7d046110fd7462f676d8d.tar.bz2
portage-a4336dd925767f1a78d7d046110fd7462f676d8d.zip
ecompress: beware of -k in PORTAGE_COMPRESS_FLAGS
This will fix bug #372183.
-rwxr-xr-xbin/ebuild-helpers/ecompress5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/ebuild-helpers/ecompress b/bin/ebuild-helpers/ecompress
index de81b4484..9ff1c563f 100755
--- a/bin/ebuild-helpers/ecompress
+++ b/bin/ebuild-helpers/ecompress
@@ -80,7 +80,10 @@ case $1 in
# if it cannot actually compress the file
echo {0..1000} > compressme
${PORTAGE_COMPRESS} ${PORTAGE_COMPRESS_FLAGS} compressme > /dev/null
- suffix=$(ls compressme*)
+ # If PORTAGE_COMPRESS_FLAGS contains -k then we need to avoid
+ # having our glob match the uncompressed file here.
+ suffix=$(echo compressme.*)
+ [[ -z $suffix ]] && suffix=$(echo compressme*)
suffix=${suffix#compressme}
cd /
rm -rf "${tmpdir}"