]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
naoki: Use pigz for toolchain decompression if available.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 13 May 2010 11:13:38 +0000 (13:13 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 13 May 2010 11:13:38 +0000 (13:13 +0200)
tools/toolchain

index 7eff6fa07037ca9d6c5d3ebd096d9f76c8981e9c..487c73da1a447fff16f2b62d52701f4d22def8ba 100755 (executable)
@@ -2,6 +2,11 @@
 
 . $(dirname ${0})/common-functions
 
+gzip=gzip
+if [ -x "/usr/bin/pigz" ]; then
+       gzip=pigz
+fi
+
 case "${1}" in
        adjust)
                TARGET_PATH=${2}
@@ -65,7 +70,7 @@ case "${1}" in
                        strip --strip-all ${file}
                done
 
-               cd ${COMPRESS_PATH} && tar --posix -czf ${target} -p -S * || exit 1
+               cd ${COMPRESS_PATH} && tar --posix -c -p -S * | ${gzip} -9 > ${target}
 
                cat ${target} > ${TARGET}
                rm -f ${target}
@@ -75,7 +80,7 @@ case "${1}" in
                ARCHIVE=${2}
                TARGET_PATH=${3}
 
-               tar xfz ${ARCHIVE} -C ${TARGET_PATH}
+               ${gzip} -d < ${ARCHIVE} | tar x -C ${TARGET_PATH}
                ;;
 
 esac