summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-03-17 02:28:22 +0000
committerMike Frysinger <vapier@gentoo.org>2007-03-17 02:28:22 +0000
commit210d4138cb80dc7c7bf78c36d56afd97f6dd627a (patch)
treed49f5e2c015fbf331a4f8c4aed9e914e7d962b24
parent962b3142f6aea84fa7f87277763567cfbbe264e1 (diff)
downloadportage-210d4138cb80dc7c7bf78c36d56afd97f6dd627a.tar.gz
portage-210d4138cb80dc7c7bf78c36d56afd97f6dd627a.tar.bz2
portage-210d4138cb80dc7c7bf78c36d56afd97f6dd627a.zip
forcibly break all hard links so we dont need to rely on --force in compressor and tweak the _relocate_skip_dirs() func to handle whitespace in paths (thanks to zmedico for tip)
svn path=/main/trunk/; revision=6221
-rwxr-xr-xbin/ecompressdir9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/ecompressdir b/bin/ecompressdir
index 50e8ec7a6..a037adc60 100755
--- a/bin/ecompressdir
+++ b/bin/ecompressdir
@@ -74,14 +74,13 @@ funk_up_dir() {
# _relocate_skip_dirs(srctree, dsttree)
# Move all the directories we want to skip running compression
# on from srctree to dsttree.
-# TODO: this should support whitespace in paths ...
_relocate_skip_dirs() {
local srctree="$1" dsttree="$2"
[[ -d ${srctree} ]] || return 0
- local src dst parent
- for src in $(find "${srctree}" -name '*.ecompress.skip') ; do
+ find "${srctree}" -name '*.ecompress.skip' -print0 | \
+ while read -d $'\0' src ; do
src=${src%.ecompress.skip}
dst="${dsttree}${src#${srctree}}"
parent=${dst%/*}
@@ -117,6 +116,10 @@ for dir in "$@" ; do
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 \
+ 'cp -p "${file}"{,.ecompress.break} ; mv -f "${file}"{.ecompress.break,}' \;
+
# now lets do our work
[[ -z ${suffix} ]] && continue
vecho "${0##*/}: $(ecompress --bin) ${dir#${D}}"