summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-03-28 19:05:01 +0000
committerZac Medico <zmedico@gentoo.org>2007-03-28 19:05:01 +0000
commit57bdd50cd8428881d6ff6a72547d9bccee532688 (patch)
tree2082ba53747de000c560be205e224186b76d07b9
parentCorrectly pull the metadata again when the node is converted. (trunk r6306:6307) (diff)
downloadportage-multirepo-57bdd50cd8428881d6ff6a72547d9bccee532688.tar.gz
portage-multirepo-57bdd50cd8428881d6ff6a72547d9bccee532688.tar.bz2
portage-multirepo-57bdd50cd8428881d6ff6a72547d9bccee532688.zip
For bug #172539, fix ecompressdir suffix handling so that automatic decompression of Z, gz, and bz2 suffixes works properly. (trunk r6308:6309)
svn path=/main/branches/2.1.2/; revision=6310
-rwxr-xr-xbin/ecompressdir12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/ecompressdir b/bin/ecompressdir
index d061db1f..08acd2cc 100755
--- a/bin/ecompressdir
+++ b/bin/ecompressdir
@@ -25,7 +25,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 | \
@@ -34,11 +34,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
}
@@ -53,9 +53,9 @@ for dir in "$@" ; do
fi
# 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 \