forcibly break all hard links so we dont need to rely on --force in compressor (trunk...
authorZac Medico <zmedico@gentoo.org>
Tue, 27 Mar 2007 20:55:42 +0000 (20:55 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 27 Mar 2007 20:55:42 +0000 (20:55 -0000)
svn path=/main/branches/2.1.2/; revision=6296

bin/ecompressdir

index cad0ce26c0c454079e8dc56b42cf5aa5044ae85e..d061db1f79eb7419adf5d7521289620067df2006 100755 (executable)
@@ -57,6 +57,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}}"