wok-stable rev 2080
xarchive: add ipk support
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Jan 24 20:08:27 2009 +0000 (2009-01-24) |
parents | 0fc4267b0ab7 |
children | a3be05221ec0 |
files | xarchive/stuff/slitaz-wrap.sh |
line diff
1.1 --- a/xarchive/stuff/slitaz-wrap.sh Sat Jan 24 16:18:49 2009 +0000 1.2 +++ b/xarchive/stuff/slitaz-wrap.sh Sat Jan 24 20:08:27 2009 +0000 1.3 @@ -26,6 +26,7 @@ 1.4 LZMA_EXTS="tar.lz tar.lzma tlz" 1.5 BZIP2_EXTS="tar.bz tbz tar.bz2 tbz2" 1.6 COMPRESS_EXTS="tar.z tar.Z" 1.7 +IPK_EXTS="ipk" 1.8 CPIO_EXTS="cpio" 1.9 CPIOGZ_EXTS="cpio.gz" 1.10 ZIP_EXTS="zip cbz jar" 1.11 @@ -56,12 +57,22 @@ 1.12 archive="$1" 1.13 test -z $1 || shift 1 1.14 1.15 +decompress_ipk() 1.16 +{ 1.17 + tar xOzf "$1" ./data.tar.gz | gzip -dc 1.18 +} 1.19 + 1.20 # set up compression variables for our compression functions. 1.21 # translate archive name to lower case for pattern matching. 1.22 # use compressor -c option to output to stdout and direct it where we want 1.23 lc_archive="$(echo $archive|tr [:upper:] [:lower:])" 1.24 DECOMPRESS="cat" 1.25 COMPRESS="cat" 1.26 +for ext in $IPK_EXTS; do 1.27 + if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 1.28 + DECOMPRESS="decompress_ipk" 1.29 + fi 1.30 +done 1.31 for ext in $GZIP_EXTS $CPIOGZ_EXTS; do 1.32 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 1.33 DECOMPRESS="gzip -dc" 1.34 @@ -258,7 +269,7 @@ 1.35 -i) # info: output supported extentions for progs that exist 1.36 for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS \ 1.37 $CPIO_EXTS $CPIOGZ_EXTS $ZIP_EXTS $DEB_EXTS $RPM_EXTS \ 1.38 - $TAZPKG_EXTS $ISO_EXTS $FS_EXTS; do 1.39 + $TAZPKG_EXTS $ISO_EXTS $FS_EXTS $IPK_EXTS; do 1.40 printf "%s;" $ext 1.41 if [ "$ext" = "zip" -a ! "$(which zip)" ]; then 1.42 echo warning: zip not found, extract only >/dev/stderr 1.43 @@ -280,7 +291,8 @@ 1.44 ;; 1.45 1.46 -o) # open: mangle output of tar cmd for xarchive 1.47 - for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS; do 1.48 + for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS \ 1.49 + $IPK_EXTS; do 1.50 # format of tar output: 1.51 # lrwxrwxrwx USR/GRP 0 2005-05-12 00:32:03 file -> /path/to/link 1.52 # -rw-r--r-- USR/GRP 6622 2005-04-22 12:29:14 file 1.53 @@ -565,7 +577,8 @@ 1.54 ;; 1.55 1.56 -e) # extract: from archive passed files 1.57 - for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS; do 1.58 + for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS \ 1.59 + $IPK_EXTS; do 1.60 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 1.61 # xarchive will put is the right extract dir 1.62 # so we just have to extract.