tazwok rev 150
tazwok: enable tazpkg lzma compression
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Sep 18 09:53:45 2009 +0200 (2009-09-18) |
parents | fbcc882cbb65 |
children | e49ca096d97d |
files | examples/tazwok.conf tazwok |
line diff
1.1 --- a/examples/tazwok.conf Thu Aug 20 13:29:49 2009 +0200 1.2 +++ b/examples/tazwok.conf Fri Sep 18 09:53:45 2009 +0200 1.3 @@ -41,3 +41,7 @@ 1.4 FSH="bin boot dev etc home init lib media mnt proc root sbin share sys \ 1.5 tmp usr var vz usr/bin usr/games usr/include usr/lib usr/local usr/sbin \ 1.6 usr/share usr/src" 1.7 + 1.8 +# tazpkg compression "gzip" or "lzma" 1.9 +COMPRESSION="lzma" 1.10 +
2.1 --- a/tazwok Thu Aug 20 13:29:49 2009 +0200 2.2 +++ b/tazwok Fri Sep 18 09:53:45 2009 +0200 2.3 @@ -590,8 +590,12 @@ 2.4 # Build cpio archives. Find, cpio and gzip the fs, finish by 2.5 # removing the fs tree. 2.6 echo -n "Compressing the fs... " 2.7 - find fs -print | cpio -o -H newc | gzip > fs.cpio.gz && rm -rf fs 2.8 - PACKED_SIZE=$(du -chs fs.cpio.gz receipt files.list md5sum \ 2.9 + find fs -print | cpio -o -H newc | case "$PACKAGE-$COMPRESSION" in 2.10 + tazpkg-lzma) gzip > fs.cpio.gz;; 2.11 + *-lzma) lzma e fs.cpio.lzma -si;; 2.12 + *) gzip > fs.cpio.gz;; 2.13 + esac && rm -rf fs 2.14 + PACKED_SIZE=$(du -chs fs.cpio.* receipt files.list md5sum \ 2.15 description.txt 2> /dev/null | awk '{ sz=$1 } END { print sz }') 2.16 status 2.17 echo -n "Updating receipt sizes..." 2.18 @@ -611,8 +615,8 @@ 2.19 status 2.20 # Restore package tree incase we want to browse it. 2.21 echo -n "Restoring original package tree... " 2.22 - zcat fs.cpio.gz | cpio -id 2.23 - rm fs.cpio.gz && cd .. 2.24 + ( zcat fs.cpio.gz 2> /dev/null || unlzma -c fs.cpio.lzma ) | cpio -id 2.25 + rm fs.cpio.* && cd .. 2.26 # Log process. 2.27 echo "$PACKAGE-$VERSION$EXTRAVERSION.tazpkg (done)" >> $LOG 2.28 echo "================================================================================"