summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-03-28 18:58:58 +0000
committerZac Medico <zmedico@gentoo.org>2007-03-28 18:58:58 +0000
commit75bbd42c4be2151c06a60594ea4f08c451d13b50 (patch)
treebca1234d1fe7ddbd381199790d16c10fd0f81815
parent7209946c181c264c96adab8ddae77f884bd710cc (diff)
downloadportage-75bbd42c4be2151c06a60594ea4f08c451d13b50.tar.gz
portage-75bbd42c4be2151c06a60594ea4f08c451d13b50.tar.bz2
portage-75bbd42c4be2151c06a60594ea4f08c451d13b50.zip
For bug #172539, fix ecompressdir suffix handling so that automatic decompression of Z, gz, and bz2 suffixes works properly.
svn path=/main/trunk/; revision=6309
-rwxr-xr-xbin/ecompressdir12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/ecompressdir b/bin/ecompressdir
index a037adc60..22ab4310c 100755
--- a/bin/ecompressdir
+++ b/bin/ecompressdir
@@ -53,7 +53,7 @@ funk_up_dir() {
[[ ${act} == "compress" ]] && negate="!"
# first we act on all the files
- find "${dir}" -type f ${negate} -iname '*.'${suffix} -print0 | ${XARGS} -0 ${binary}
+ find "${dir}" -type f ${negate} -iname '*'${suffix} -print0 | ${XARGS} -0 ${binary}
((ret+=$?))
find "${dir}" -type l -print0 | \
@@ -62,11 +62,11 @@ funk_up_dir() {
olddest=$(readlink "${brokenlink}")
[[ ${act} == "compress" ]] \
&& newdest="${olddest}${suffix}" \
- || newdest="${olddest%.${suffix}}"
+ || newdest="${olddest%${suffix}}"
rm -f "${brokenlink}"
[[ ${act} == "compress" ]] \
&& ln -snf "${newdest}" "${brokenlink}${suffix}" \
- || ln -snf "${newdest}" "${brokenlink%.${suffix}}"
+ || ln -snf "${newdest}" "${brokenlink%${suffix}}"
((ret+=$?))
done
}
@@ -112,9 +112,9 @@ for dir in "$@" ; do
find "${dir}" -type f -name '*.ecompress.file' -print0 | ${XARGS} -0 rm -f
# not uncommon for packages to compress doc files themselves
- funk_up_dir "decompress" "Z" "gunzip"
- funk_up_dir "decompress" "gz" "gunzip"
- funk_up_dir "decompress" "bz2" "bunzip2"
+ funk_up_dir "decompress" ".Z" "gunzip"
+ funk_up_dir "decompress" ".gz" "gunzip"
+ funk_up_dir "decompress" ".bz2" "bunzip2"
# forcibly break all hard links as some compressors whine about it
find "${dir}" -type f -links +1 -exec env file="{}" sh -c \