]> git.ipfire.org Git - people/ms/pakfire.git/commitdiff
Fix symlinks to compressed man pages.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Dec 2011 09:56:45 +0000 (10:56 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Dec 2011 09:56:45 +0000 (10:56 +0100)
scripts/compress-man-pages

index 1b250d7a761e396ec01df82dded819dd1951bf97..e546f4b295256af452b7cbcba178350be2382c58 100755 (executable)
@@ -1,5 +1,8 @@
 #!/bin/bash
 
+COMPRESSOR=xz
+COMPRESS_EXT=.xz
+
 echo "Compressing man pages..."
 
 BUILDROOT=${1}
@@ -18,7 +21,14 @@ for file in $(find ${BUILDROOT}/usr/share/man -type f); do
        esac
 
        echo "  Compressing man page ${file//${BUILDROOT}/}..."
-       xz ${file}
+       ${COMPRESSOR} ${file}
+done
+
+for file in $(find ${BUILDROOT}/usr/share/man -type l); do
+       link=$(ls -l ${file} | sed -e 's/.* -> //' -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//')
+       rm -f ${file}
+       b=$(echo ${file} | sed -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//')
+       ln -sf ${link}${COMPRESS_EXT} ${b}${COMPRESS_EXT}
 done
 
 exit 0