wok-4.x rev 3194

Xarchive: add lzo support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed May 27 10:54:26 2009 +0200 (2009-05-27)
parents 21b155a7fff1
children 77070ef5bae8
files xarchive/receipt xarchive/stuff/slitaz-wrap.sh
line diff
     1.1 --- a/xarchive/receipt	Wed May 27 10:51:59 2009 +0200
     1.2 +++ b/xarchive/receipt	Wed May 27 10:54:26 2009 +0200
     1.3 @@ -8,7 +8,7 @@
     1.4  TARBALL="$PACKAGE-$VERSION.tar.gz"
     1.5  DEPENDS="gtk+ xorg-libXdamage"
     1.6  BUILD_DEPENDS="pkg-config gtk+ gtk+-dev"
     1.7 -SUGGESTED="zip rar unace arj lha p7zip"
     1.8 +SUGGESTED="zip rar unace arj lha p7zip lzop"
     1.9  WEB_SITE="http://xarchive.sourceforge.net/"
    1.10  WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    1.11  
     2.1 --- a/xarchive/stuff/slitaz-wrap.sh	Wed May 27 10:51:59 2009 +0200
     2.2 +++ b/xarchive/stuff/slitaz-wrap.sh	Wed May 27 10:54:26 2009 +0200
     2.3 @@ -40,6 +40,7 @@
     2.4  CLOOP_EXTS="cloop"
     2.5  RAR_EXTS="rar cbr"
     2.6  LHA_EXTS="lha lzh lzs"
     2.7 +LZO_EXTS="lzo"
     2.8  
     2.9  # Setup awk program
    2.10  AWK_PROGS="mawk gawk awk"
    2.11 @@ -331,6 +332,7 @@
    2.12  arj		arj
    2.13  7za		7z
    2.14  lha		$LHA_EXTS
    2.15 +lzop		$LZO_EXTS
    2.16  EOT
    2.17          printf "\n"
    2.18          exit
    2.19 @@ -622,6 +624,40 @@
    2.20                  exit 0
    2.21  	    fi
    2.22  	done
    2.23 +        for ext in $LZO_EXTS; do
    2.24 +            if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
    2.25 +        # format of lzo output:
    2.26 +# Method         Length    Packed  Ratio     Date    Time   Name
    2.27 +# ------         ------    ------  -----     ----    ----   ----
    2.28 +# LZO1X-1           626       526  84.0%  2009-05-27 09:52  file
    2.29 +# LZO1X-1         10057      5675  56.4%  2005-07-25 16:26  path/file
    2.30 +#               -------   -------  -----                    ----
    2.31 +# 1               2          3     4      5          6      7
    2.32 +                lzop -Plv "$archive" | $AWK_PROG -v uuid=$(id -u -n) '
    2.33 +	BEGIN { show = 0}
    2.34 +        {
    2.35 +          if ($5 == "----" || $4 == "----") {
    2.36 +          	show = 1 - show
    2.37 +          	next
    2.38 +          }
    2.39 +	  attr="-rw-r--r--"
    2.40 +          uid=uuid; gid=uuid
    2.41 +          size=$2
    2.42 +          date=$5
    2.43 +          time=$6
    2.44 +          
    2.45 +          #this method works with filenames that start with a space (evil!)
    2.46 +          #split line a time and a space
    2.47 +          split($0,linesplit, $6 "  ")
    2.48 +
    2.49 +          name=linesplit[2]
    2.50 +          link="-"	# links are not supported
    2.51 +
    2.52 +          if (show == 1) printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link
    2.53 +        }'
    2.54 +                exit 0
    2.55 +	    fi
    2.56 +	done
    2.57          exit $E_UNSUPPORTED
    2.58          ;;
    2.59  
    2.60 @@ -756,6 +792,7 @@
    2.61  unzip		-n	$ZIP_EXTS
    2.62  dpkg-deb	-X	$DEB_EXTS
    2.63  lha		x	$LHA_EXTS
    2.64 +lzop		-x	$LZO_EXTS
    2.65  EOT
    2.66  	while read exe args argpass exts; do
    2.67  	    [ "$(which $exe)" ] || continue