# HG changeset patch # User Pascal Bellard # Date 1254663286 -7200 # Node ID 0924b188542942b808d3c3e011119458a618412d # Parent a8aaec062c6981d7b147317204bc613e3be3b8d6 xarchive: add xz support diff -r a8aaec062c69 -r 0924b1885429 xarchive/stuff/slitaz-wrap.sh --- a/xarchive/stuff/slitaz-wrap.sh Sun Oct 04 09:50:24 2009 +0000 +++ b/xarchive/stuff/slitaz-wrap.sh Sun Oct 04 15:34:46 2009 +0200 @@ -25,10 +25,12 @@ GZIP_EXTS="tar.gz tgz" LZMA_EXTS="tar.lz tar.lzma tlz" BZIP2_EXTS="tar.bz tbz tar.bz2 tbz2" +XZ_EXTS="tar.xz txz" COMPRESS_EXTS="tar.z tar.Z" IPK_EXTS="ipk" CPIO_EXTS="cpio" CPIOGZ_EXTS="cpio.gz" +CPIOXZ_EXTS="cpio.xz" ZIP_EXTS="zip cbz jar" RPM_EXTS="rpm" DEB_EXTS="deb" @@ -36,7 +38,7 @@ ISO_EXTS="iso" SQUASHFS_EXTS="sqfs squashfs" CROMFS_EXTS="cromfs" -FS_EXTS="ext2 ext3 dos fat vfat fd fs loop" +FS_EXTS="ext2 ext3 dos fat vfat xfs fd fs loop" CLOOP_EXTS="cloop" RAR_EXTS="rar cbr" LHA_EXTS="lha lzh lzs" @@ -114,6 +116,13 @@ COMPRESS="lzma e -si -so" fi done +for ext in $XZ_EXTS $CPIOXZ_EXTS; do + if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then + [ -x /usr/bin/rx ] || exit $E_UNSUPPORTED + DECOMPRESS="xz -dc" + COMPRESS="xz -c" + fi +done for ext in $COMPRESS_EXTS; do if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then DECOMPRESS="uncompress -dc" @@ -198,7 +207,8 @@ [ "$(which bzip2)" ] || return fi if not_busybox tar && [ "$action" != "new_archive" ]; then - for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS; do + for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $XZ_EXTS \ + $COMPRESS_EXTS $LZMA_EXTS; do if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then decompress_func case "$action" in @@ -247,8 +257,8 @@ fi done done </dev/stderr fi done + [ -x /usr/bin/xz ] && for ext in $XZ_EXTS $CPIOXZ_EXTS; do + printf "%s;" $ext + done while read mod exts; do [ -f /lib/modules/$(uname -r)/kernel/$mod ] || continue for ext in $exts; do @@ -373,8 +386,8 @@ fi done done <