# HG changeset patch # User Pascal Bellard # Date 1232827707 0 # Node ID 77a4483b1fa920f4bda3d2854085baec20e6174d # Parent 0fc4267b0ab7d7e49ea61c674e23e22e209dc31b xarchive: add ipk support diff -r 0fc4267b0ab7 -r 77a4483b1fa9 xarchive/stuff/slitaz-wrap.sh --- a/xarchive/stuff/slitaz-wrap.sh Sat Jan 24 16:18:49 2009 +0000 +++ b/xarchive/stuff/slitaz-wrap.sh Sat Jan 24 20:08:27 2009 +0000 @@ -26,6 +26,7 @@ LZMA_EXTS="tar.lz tar.lzma tlz" BZIP2_EXTS="tar.bz tbz tar.bz2 tbz2" COMPRESS_EXTS="tar.z tar.Z" +IPK_EXTS="ipk" CPIO_EXTS="cpio" CPIOGZ_EXTS="cpio.gz" ZIP_EXTS="zip cbz jar" @@ -56,12 +57,22 @@ archive="$1" test -z $1 || shift 1 +decompress_ipk() +{ + tar xOzf "$1" ./data.tar.gz | gzip -dc +} + # set up compression variables for our compression functions. # translate archive name to lower case for pattern matching. # use compressor -c option to output to stdout and direct it where we want lc_archive="$(echo $archive|tr [:upper:] [:lower:])" DECOMPRESS="cat" COMPRESS="cat" +for ext in $IPK_EXTS; do + if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then + DECOMPRESS="decompress_ipk" + fi +done for ext in $GZIP_EXTS $CPIOGZ_EXTS; do if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then DECOMPRESS="gzip -dc" @@ -258,7 +269,7 @@ -i) # info: output supported extentions for progs that exist for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS \ $CPIO_EXTS $CPIOGZ_EXTS $ZIP_EXTS $DEB_EXTS $RPM_EXTS \ - $TAZPKG_EXTS $ISO_EXTS $FS_EXTS; do + $TAZPKG_EXTS $ISO_EXTS $FS_EXTS $IPK_EXTS; do printf "%s;" $ext if [ "$ext" = "zip" -a ! "$(which zip)" ]; then echo warning: zip not found, extract only >/dev/stderr @@ -280,7 +291,8 @@ ;; -o) # open: mangle output of tar cmd for xarchive - for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS; do + for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS \ + $IPK_EXTS; do # format of tar output: # lrwxrwxrwx USR/GRP 0 2005-05-12 00:32:03 file -> /path/to/link # -rw-r--r-- USR/GRP 6622 2005-04-22 12:29:14 file @@ -565,7 +577,8 @@ ;; -e) # extract: from archive passed files - for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS; do + for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS \ + $IPK_EXTS; do if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then # xarchive will put is the right extract dir # so we just have to extract.