wok-next rev 2877
remove xarchive-extras
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon May 04 13:35:07 2009 +0200 (2009-05-04) |
parents | b37d0f1205d5 |
children | d432f911ee03 |
files | xarchive-extras/receipt xarchive/receipt xarchive/stuff/slitaz-wrap.sh xarchive/stuff/slitaz-xarchive-wrappers-0.2.8-6.patch |
line diff
1.1 --- a/xarchive-extras/receipt Sun May 03 19:37:14 2009 +0000 1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 @@ -1,25 +0,0 @@ 1.4 -# SliTaz package receipt. 1.5 - 1.6 -PACKAGE="xarchive-extras" 1.7 -VERSION="0.2.8-6" 1.8 -CATEGORY="x-window" 1.9 -SHORT_DESC="XArchve command line archiving tools wrappers." 1.10 -MAINTAINER="erjo@slitaz.org" 1.11 -DEPENDS="xarchive" 1.12 -WANTED="xarchive" 1.13 -TARBALL="$PACKAGE-$VERSION.tar.gz" 1.14 -WEB_SITE="http://xarchive.sourceforge.net/" 1.15 - 1.16 - 1.17 -# Rules to gen a SliTaz package suitable for Tazpkg. 1.18 -genpkg_rules() 1.19 -{ 1.20 - mkdir -p $fs/usr/lib/xarchive/wrappers 1.21 - cp -a $_pkg/usr/lib/xarchive/wrappers/* $fs/usr/lib/xarchive/wrappers 1.22 - rm -f fs/usr/lib/xarchive/wrappers/tar-* 1.23 - rm -f fs/usr/lib/xarchive/wrappers/deb-* 1.24 - rm -f fs/usr/lib/xarchive/wrappers/rpm-* 1.25 - rm -f fs/usr/lib/xarchive/wrappers/zip-* 1.26 - sed -i 's|#!\s*/bin/bash|#!/bin/sh|' $_pkg/usr/lib/xarchive/wrappers/* 1.27 -} 1.28 -
2.1 --- a/xarchive/receipt Sun May 03 19:37:14 2009 +0000 2.2 +++ b/xarchive/receipt Mon May 04 13:35:07 2009 +0200 2.3 @@ -8,6 +8,7 @@ 2.4 TARBALL="$PACKAGE-$VERSION.tar.gz" 2.5 DEPENDS="gtk+ xorg-libXdamage" 2.6 BUILD_DEPENDS="pkg-config gtk+ gtk+-dev" 2.7 +SUGGESTED="zip rar unace arj lha p7zip" 2.8 WEB_SITE="http://xarchive.sourceforge.net/" 2.9 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" 2.10
3.1 --- a/xarchive/stuff/slitaz-wrap.sh Sun May 03 19:37:14 2009 +0000 3.2 +++ b/xarchive/stuff/slitaz-wrap.sh Mon May 04 13:35:07 2009 +0200 3.3 @@ -1,7 +1,7 @@ 3.4 #!/bin/sh 3.5 # slitaz-wrap.sh - sh slitaz core wrapper for xarchive frontend 3.6 # Copyright (C) 2005 Lee Bigelow <ligelowbee@yahoo.com> 3.7 -# Copyright (C) 2008 Pascal Bellard <pascal.bellard@slitaz.org> 3.8 +# Copyright (C) 2009 Pascal Bellard <pascal.bellard@slitaz.org> 3.9 # 3.10 # This program is free software; you can redistribute it and/or modify 3.11 # it under the terms of the GNU General Public License as published by 3.12 @@ -38,6 +38,8 @@ 3.13 CROMFS_EXTS="cromfs" 3.14 FS_EXTS="ext2 ext3 dos fat vfat fd fs loop" 3.15 CLOOP_EXTS="cloop" 3.16 +RAR_EXTS="rar cbr" 3.17 +LHA_EXTS="lha lzh lzs" 3.18 3.19 # Setup awk program 3.20 AWK_PROGS="mawk gawk awk" 3.21 @@ -49,6 +51,16 @@ 3.22 fi 3.23 done 3.24 3.25 +# Setup xterm program to use 3.26 +XTERM_PROGS="xterm rxvt xvt wterm aterm Eterm" 3.27 +XTERM_PROG="" 3.28 +for xtermprog in $XTERM_PROGS; do 3.29 + if [ "$(which $xtermprog)" ]; then 3.30 + XTERM_PROG="$xtermprog" 3.31 + break 3.32 + fi 3.33 +done 3.34 + 3.35 # setup variables opt and archive. 3.36 # the shifting will leave the files passed as 3.37 # all the remaining args "$@" 3.38 @@ -57,6 +69,16 @@ 3.39 archive="$1" 3.40 test -z $1 || shift 1 3.41 3.42 +tazpkg2cpio() 3.43 +{ 3.44 + tmpcpio="$(mktemp -d -t tmpcpio.XXXXXX)" 3.45 + cd $tmpcpio 3.46 + cpio -i fs.cpio.gz > /dev/null < "$1" 3.47 + zcat fs.cpio.gz 3.48 + cd - 3.49 + rm -rf $tmpcpio 3.50 +} 3.51 + 3.52 decompress_ipk() 3.53 { 3.54 tar xOzf "$1" ./data.tar.gz | gzip -dc 3.55 @@ -98,10 +120,15 @@ 3.56 fi 3.57 done 3.58 3.59 +do_decompress() 3.60 +{ 3.61 + $DECOMPRESS "$1" 3.62 +} 3.63 + 3.64 # Compression functions 3.65 decompress_func() 3.66 { 3.67 - if [ "$DECOMPRESS" ]; then 3.68 + if [ "$DECOMPRESS" != "cat" ]; then 3.69 tmpname="$(mktemp -t tartmp.XXXXXX)" 3.70 if [ -f "$archive" ]; then 3.71 $DECOMPRESS "$archive" > "$tmpname" 3.72 @@ -115,7 +142,7 @@ 3.73 3.74 compress_func() 3.75 { 3.76 - if [ "$COMPRESS" ] && [ "$oldarch" ]; then 3.77 + if [ "$COMPRESS" != "cat" ] && [ "$oldarch" ]; then 3.78 [ -f "$oldarch" ] && rm "$oldarch" 3.79 if $COMPRESS < "$archive" > "$oldarch"; then 3.80 rm "$archive" 3.81 @@ -131,6 +158,26 @@ 3.82 return 0 3.83 } 3.84 3.85 +addtar() 3.86 +{ 3.87 + tar -cf - $@ 3.88 +} 3.89 + 3.90 +extracttar() 3.91 +{ 3.92 + tar -xf - 3.93 +} 3.94 + 3.95 +addcpio() 3.96 +{ 3.97 + find $@ | cpio -o -H newc 3.98 +} 3.99 + 3.100 +extractcpio() 3.101 +{ 3.102 + cpio -id > /dev/null 3.103 +} 3.104 + 3.105 add_file() 3.106 { 3.107 ( cd $2 ; tar -cf - $1 ) | tar -xf - 3.108 @@ -146,42 +193,50 @@ 3.109 action=$1 3.110 shift 3.111 tardir="$(dirname "$archive")" 3.112 - [ $(expr "$lc_archive" : ".*\."$BZIP2_EXTS"$") -gt 0 ] && ! which bzip2 && return 3.113 - for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS; do 3.114 - if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.115 - if [ "$action" = "new_archive" ]; then 3.116 - decompress_func 3.117 - cd "$tardir" 3.118 - tar -cf "$archive" "${1#$tardir/}" 3.119 - status=$? 3.120 - compress_func 3.121 - exit $status 3.122 - fi 3.123 - if not_busybox tar; then 3.124 + if [ $(expr "$lc_archive" : ".*\."$BZIP2_EXTS"$") -gt 0 ]; then 3.125 + [ "$(which bzip2)" ] || return 3.126 + fi 3.127 + if not_busybox tar && [ "$action" != "new_archive" ]; then 3.128 + for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS; do 3.129 + if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.130 decompress_func 3.131 case "$action" in 3.132 remove_file) 3.133 tar --delete -f "$archive" "$@";; 3.134 add_file) 3.135 cd "$tardir" 3.136 - tar -rf "$archive" "${1#$tardir/}";; 3.137 - *) false;; 3.138 + while [ -n "$1" ]; do 3.139 + tar -rf "$archive" "${1#$tardir/}" 3.140 + done;; 3.141 esac 3.142 status=$? 3.143 compress_func 3.144 exit $status 3.145 + fi 3.146 + done 3.147 + fi 3.148 + while read add extract exts; do 3.149 + for ext in $exts; do 3.150 + if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.151 + if [ "$action" = "new_archive" ]; then 3.152 + decompress_func 3.153 + cd "$tardir" 3.154 + $add "${1#$tardir/}" > "$archive" 3.155 + status=$? 3.156 + compress_func 3.157 + exit $status 3.158 fi 3.159 tmptar="$(mktemp -d -t tartmp.XXXXXX)" 3.160 here="$(pwd)" 3.161 cd $tmptar 3.162 - $DECOMPRESS < "$archive" | tar -xf - 3.163 + $DECOMPRESS "$archive" | $extract 3.164 status=$? 3.165 if [ $status -eq 0 -a -n "$1" ]; then 3.166 - while [ "$1" ]; do 3.167 + while [ "$1" ]; do 3.168 $action "${1#$tardir/}" $here 3.169 shift 3.170 - done 3.171 - tar -cf - $(ls -a | grep -v ^\.$ | grep -v ^\.\.$) | \ 3.172 + done 3.173 + $add $(ls -a | grep -v ^\.$ | grep -v ^\.\.$) | \ 3.174 $COMPRESS > "$archive" 3.175 status=$? 3.176 fi 3.177 @@ -189,57 +244,35 @@ 3.178 rm -rf $tmptar 3.179 exit $status 3.180 fi 3.181 - done 3.182 - for ext in $CPIO_EXTS $CPIOGZ_EXTS; do 3.183 - if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.184 - if [ "$action" = "new_archive" ]; then 3.185 - decompress_func 3.186 - cd "$tardir" 3.187 - echo "${1#$tardir/}" | cpio -o -H newc > "$archive" 3.188 - status=$? 3.189 - compress_func 3.190 - exit $status 3.191 - fi 3.192 - tmpcpio="$(mktemp -d -t cpiotmp.XXXXXX)" 3.193 - here="$(pwd)" 3.194 - cd $tmpcpio 3.195 - $DECOMPRESS "$archive" | cpio -id > /dev/null 3.196 - status=$? 3.197 - if [ $status -eq 0 -a -n "$1" ]; then 3.198 - while [ "$1" ]; do 3.199 - $action "${1#$tardir/}" $here 3.200 - shift 3.201 - done 3.202 - find . | cpio -o -H newc | $COMPRESS > "$archive" 3.203 - status=$? 3.204 - fi 3.205 - cd $here 3.206 - rm -rf $tmpcpio 3.207 - exit $status 3.208 - fi 3.209 - done 3.210 + done 3.211 + done <<EOT 3.212 +addtar extracttar $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS 3.213 +addcpio extractcpio $CPIO_EXTS $CPIOGZ_EXTS 3.214 +EOT 3.215 } 3.216 3.217 loop_fs() 3.218 { 3.219 tmpfs="$(mktemp -d -t fstmp.XXXXXX)" 3.220 umnt="umount -d" 3.221 + ext=${lc_archive##*.} 3.222 + case " $CROMFS_EXTS " in 3.223 + *\ $ext\ *) umnt="fusermount -u" 3.224 + cromfs-driver "$archive" $tmpfs;; 3.225 + esac 3.226 case " $CLOOP_EXTS " in 3.227 - \ $1\ ) mount -o loop=/dev/cloop,ro "$archive" $tmpfs;; 3.228 + *\ $ext\ *) mount -o loop=/dev/cloop,ro "$archive" $tmpfs;; 3.229 esac 3.230 case " $FS_EXTS " in 3.231 - \ $1\ ) mount -o loop,rw "$archive" $tmpfs;; 3.232 + *\ $ext\ *) mount -o loop,rw "$archive" $tmpfs;; 3.233 esac 3.234 - case " $ISO_EXTS " in 3.235 - \ $1\ ) mount -o loop,ro -t iso9660 "$archive" $tmpfs;; 3.236 + case " $ISO_EXTS $SQUASHFS_EXTS " in 3.237 + *\ $ext\ *) mount -o loop,ro "$archive" $tmpfs;; 3.238 esac 3.239 - case " $SQUASHFS_EXTS " in 3.240 - \ $1\ ) mount -o loop,ro -t squashfs "$archive" $tmpfs;; 3.241 - esac 3.242 - case " $CROMFS_EXTS " in 3.243 - \ $1\ ) cromfs-driver "$archive" $tmpfs; umnt="fusermount -u";; 3.244 - esac 3.245 - case "$2" in 3.246 + rmdir $tmpfs 2> /dev/null && exit $E_UNSUPPORTED 3.247 + cmd=$1 3.248 + shift 3.249 + case "$cmd" in 3.250 stat) find $tmpfs | while read f; do 3.251 [ "$f" = "$tmpfs" ] && continue 3.252 link="-" 3.253 @@ -248,21 +281,22 @@ 3.254 '{ printf "%s;%s\n",$1,substr($2,0,8)}') 3.255 echo "${f#$tmpfs/};$(stat -c "%s;%A;%U;%G" $f);$date;$link" 3.256 done;; 3.257 - copy) if [ -z "$3" ]; then 3.258 + copy) if [ -z "$1" ]; then 3.259 ( cd $tmpfs ; tar cf - . ) | tar xf - 3.260 else 3.261 - while [ -n "$3" ]; do 3.262 - ( cd $tmpfs ; tar cf - "$3" ) | tar xf - 3.263 + while [ -n "$1" ]; do 3.264 + ( cd $tmpfs ; tar cf - "$1" ) | tar xf - 3.265 shift; 3.266 done 3.267 fi;; 3.268 add) tar cf - "$@" | ( cd $tmpfs ; tar xf - );; 3.269 - remove) while [ -n "$3" ]; do 3.270 - rm -rf $tmpfs/$3 3.271 + remove) while [ -n "$1" ]; do 3.272 + rm -rf $tmpfs/$1 3.273 done;; 3.274 esac 3.275 $umnt $tmpfs 3.276 rmdir $tmpfs 3.277 + exit 0 3.278 } 3.279 3.280 # the option switches 3.281 @@ -276,63 +310,41 @@ 3.282 echo warning: zip not found, extract only >/dev/stderr 3.283 fi 3.284 done 3.285 - [ -d /lib/modules/$(uname -r)/kernel/fs/squashfs/squashfs.ko ] && \ 3.286 - for ext in $SQUASHFS_EXTS; do 3.287 - printf "%s;" $ext 3.288 - done 3.289 - [ -x /bin/cromfs-driver ] && for ext in $CROMFS_EXTS; do 3.290 - printf "%s;" $ext 3.291 - done 3.292 - [ -d /lib/modules/$(uname -r)/kernel/drivers/block/cloop.ko ] && \ 3.293 - for ext in $CLOOP_EXTS; do 3.294 - printf "%s;" $ext 3.295 - done 3.296 + while read mod exts; do 3.297 + [ -f /lib/modules/$(uname -r)/kernel/$mod ] || continue 3.298 + for ext in $exts; do 3.299 + printf "%s;" $ext 3.300 + done 3.301 + done <<EOT 3.302 +fs/squashfs/squashfs.ko $SQUASHFS_EXTS 3.303 +drivers/block/cloop.ko $CLOOP_EXTS 3.304 +EOT 3.305 + while read exe exts; do 3.306 + [ "$(which $exe)" ] || continue 3.307 + for ext in $exts; do 3.308 + printf "%s;" $ext 3.309 + done 3.310 + done <<EOT 3.311 +cromfs-driver $CROMFS_EXTS 3.312 +rar $RAR_EXTS 3.313 +unace ace 3.314 +arj arj 3.315 +7za 7z 3.316 +lha $LHA_EXTS 3.317 +EOT 3.318 printf "\n" 3.319 exit 3.320 ;; 3.321 3.322 -o) # open: mangle output of tar cmd for xarchive 3.323 - for ext in $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS \ 3.324 - $IPK_EXTS; do 3.325 - # format of tar output: 3.326 -# lrwxrwxrwx USR/GRP 0 2005-05-12 00:32:03 file -> /path/to/link 3.327 -# -rw-r--r-- USR/GRP 6622 2005-04-22 12:29:14 file 3.328 -# 1 2 3 4 5 6 3.329 - if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.330 - $DECOMPRESS "$archive" | tar -tvf - | $AWK_PROG ' 3.331 - { 3.332 - attr=$1 3.333 - split($2,ids,"/") #split up the 2nd field to get uid/gid 3.334 - uid=ids[1] 3.335 - gid=ids[2] 3.336 - size=$3 3.337 - date=$4 3.338 - time=$5 3.339 - 3.340 - #this method works with filenames that start with a space (evil!) 3.341 - #split line a time and a space 3.342 - split($0,linesplit, $5 " ") 3.343 - #then split the second item (name&link) at the space arrow space 3.344 - split(linesplit[2], nlsplit, " -> ") 3.345 - 3.346 - name=nlsplit[1] 3.347 - link=nlsplit[2] 3.348 - 3.349 - if (! link) {link="-"} #if there was no link set it to a dash 3.350 - 3.351 - printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link 3.352 - }' 3.353 - exit 3.354 - fi 3.355 - done 3.356 - 3.357 - for ext in $CPIO_EXTS $CPIOGZ_EXTS; do 3.358 + while read cmd filter exts; do 3.359 + for ext in $exts; do 3.360 # format of cpio output: 3.361 # lrwxrwxrwx USR/GRP 0 2005-05-12 00:32:03 file -> /path/to/link 3.362 # -rw-r--r-- USR/GRP 6622 2005-04-22 12:29:14 file 3.363 # 1 2 3 4 5 6 3.364 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.365 - $DECOMPRESS "$archive" | cpio -tv | $AWK_PROG ' 3.366 + $cmd "$archive" | $filter | $AWK_PROG ' 3.367 { 3.368 attr=$1 3.369 split($2,ids,"/") #split up the 2nd field to get uid/gid 3.370 @@ -355,13 +367,18 @@ 3.371 3.372 if (name != "" && uid != "blocks") printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link 3.373 }' 3.374 - exit 3.375 + exit 0 3.376 fi 3.377 done 3.378 - 3.379 + done <<EOT 3.380 +do_decompress cpio\ -tv $CPIO_EXTS $CPIOGZ_EXTS 3.381 +do_decompress tar\ -tvf\ - $TAR_EXTS $GZIP_EXTS $BZIP2_EXTS $COMPRESS_EXTS $LZMA_EXTS $IPK_EXTS 3.382 +rpm2cpio cpio\ -tv $RPM_EXTS 3.383 +tazpkg2cpio cpio\ -tv $TAZPKG_EXTS 3.384 +EOT 3.385 for ext in $ZIP_EXTS; do 3.386 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.387 - if which zipinfo; then 3.388 + if [ "$(which zipinfo)" ]; then 3.389 # format of zipinfo -T -s-h- output: 3.390 # -rw-r--r-- 2.3 unx 11512 tx defN YYYYMMDD.HHMMSS file 3.391 # 1 2 3 4 5 6 7 8 3.392 @@ -385,7 +402,7 @@ 3.393 name=linesplit[2] 3.394 printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link 3.395 }' 3.396 - exit 3.397 + exit 0 3.398 else 3.399 # format of unzip -l output: 3.400 # 6622 2005-04-22 12:29:14 file 3.401 @@ -413,114 +430,198 @@ 3.402 3.403 if (name != "" && n > 3) printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link 3.404 }' 3.405 - exit 3.406 + exit 0 3.407 fi 3.408 fi 3.409 done 3.410 3.411 - for ext in $RPM_EXTS; do 3.412 - if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.413 - rpm2cpio "$archive" | cpio -tv | $AWK_PROG ' 3.414 - { 3.415 - attr=$1 3.416 - split($2,ids,"/") #split up the 2nd field to get uid/gid 3.417 - uid=ids[1] 3.418 - gid=ids[2] 3.419 - size=$3 3.420 - date=$4 3.421 - time=$5 3.422 - 3.423 - #this method works with filenames that start with a space (evil!) 3.424 - #split line a time and a space 3.425 - split($0,linesplit, $5 " ") 3.426 - #then split the second item (name&link) at the space arrow space 3.427 - split(linesplit[2], nlsplit, " -> ") 3.428 - 3.429 - name=substr(nlsplit[1],2) 3.430 - link=nlsplit[2] 3.431 - 3.432 - if (! link) {link="-"} #if there was no link set it to a dash 3.433 - 3.434 - if (name != "" && uid != "blocks") printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link 3.435 - }' 3.436 - exit 3.437 - fi 3.438 - done 3.439 - 3.440 - for ext in $DEB_EXTS; do 3.441 - if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.442 - dpkg-deb -c "$archive" | $AWK_PROG ' 3.443 - { 3.444 - attr=$1 3.445 - split($2,ids,"/") #split up the 2nd field to get uid/gid 3.446 - uid=ids[1] 3.447 - gid=ids[2] 3.448 - size=$3 3.449 - date=$4 3.450 - time=$5 3.451 - 3.452 - #this method works with filenames that start with a space (evil!) 3.453 - #split line a time and a space 3.454 - split($0,linesplit, $5 " ") 3.455 - #then split the second item (name&link) at the space arrow space 3.456 - split(linesplit[2], nlsplit, " -> ") 3.457 - 3.458 - name=substr(nlsplit[1],2) 3.459 - link=nlsplit[2] 3.460 - 3.461 - if (! link) {link="-"} #if there was no link set it to a dash 3.462 - 3.463 - printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link 3.464 - }' 3.465 - exit 3.466 - fi 3.467 - done 3.468 - 3.469 - for ext in $TAZPKG_EXTS; do 3.470 - # format of cpio output: 3.471 -# lrwxrwxrwx USR/GRP 0 2005-05-12 00:32:03 file -> /path/to/link 3.472 -# -rw-r--r-- USR/GRP 6622 2005-04-22 12:29:14 file 3.473 -# 1 2 3 4 5 6 3.474 - if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.475 - tmpcpio="$(mktemp -d -t cpiotmp.XXXXXX)" 3.476 - here="$(pwd)" 3.477 - cd $tmpcpio 3.478 - cpio -i fs.cpio.gz > /dev/null < "$archive" 3.479 - zcat fs.cpio.gz | cpio -tv | $AWK_PROG ' 3.480 - { 3.481 - attr=$1 3.482 - split($2,ids,"/") #split up the 2nd field to get uid/gid 3.483 - uid=ids[1] 3.484 - gid=ids[2] 3.485 - size=$3 3.486 - date=$4 3.487 - time=$5 3.488 - 3.489 - #this method works with filenames that start with a space (evil!) 3.490 - #split line a time and a space 3.491 - split($0,linesplit, $5 " ") 3.492 - #then split the second item (name&link) at the space arrow space 3.493 - split(linesplit[2], nlsplit, " -> ") 3.494 - 3.495 - name=substr(nlsplit[1],3) 3.496 - link=nlsplit[2] 3.497 - 3.498 - if (! link) {link="-"} #if there was no link set it to a dash 3.499 - 3.500 - if (name != "" && uid != "blocks") printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link 3.501 - }' 3.502 - cd $here 3.503 - rm -rf $tmpcpio 3.504 - exit 3.505 - fi 3.506 - done 3.507 - 3.508 for ext in $ISO_EXTS $SQUASHFS_EXTS $CROMFS_EXTS $CLOOP_EXTS $FS_EXTS; do 3.509 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.510 - loop_fs $ext stat 3.511 - exit 3.512 + loop_fs stat 3.513 fi 3.514 done 3.515 + for ext in $RAR_EXTS; do 3.516 + if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.517 + # format of rar output: 3.518 +#------------------------------------- 3.519 +# bookmarks/mozilla_bookmarks.html 3.520 +# 11512 5231 45% 28-02-05 16:19 -rw-r--r-- F3F3477F m3b 2.9 3.521 +# (or 11512 5231 45% 28-02-05 16:19 .D.... 00000000 m3b 2.9) 3.522 +# (or 11512 5231 45% 28-02-05 16:19 .....S F3F3477F m3b 2.9) 3.523 +# 1 2 3 4 5 6 7 8 9 3.524 +#------------------------------------- 3.525 + 3.526 + rar v -c- "$archive" | $AWK_PROG -v uuid=$(id -u -n) ' 3.527 + # The body of info we wish to process starts with a dashed line 3.528 + # so set a flag to signal when to start and stop processing. 3.529 + # The name is on one line with the info on the next so toggle 3.530 + # a line flag letting us know what kinda info to get. 3.531 + BEGIN { flag=0; line=0 } 3.532 + /^------/ { flag++; if (flag > 1) exit 0; next} #line starts with dashs 3.533 + { 3.534 + if (flag == 0) next #not in the body yet so grab the next line 3.535 + if (line == 0) #this line contains the name 3.536 + { 3.537 + name=substr($0,2) #strip the single space from start of name 3.538 + line++ #next line will contain the info so increase the flag 3.539 + next 3.540 + } 3.541 + else #we got here so this line contains the info 3.542 + { 3.543 + size=$1 3.544 + date=$4 3.545 + time=$5 3.546 + 3.547 + #modify attributes to read more unix like if they are not 3.548 + if (index($6, "D") != 0) {attr="drwxr-xr-x"} 3.549 + else if (index($6, ".") != 0) {attr="-rw-r--r--"} 3.550 + else {attr=$6} 3.551 + 3.552 + uid=uuid 3.553 + gid=uuid 3.554 + link="-" 3.555 + 3.556 + printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link 3.557 + line=0 #next line will be a name so reset the flag 3.558 + } 3.559 + }' 3.560 + exit 0 3.561 + fi 3.562 + done 3.563 + for ext in ace; do 3.564 + if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.565 + # format of ace output: 3.566 + # Date ³Time ³Packed ³Size ³Ratio³File 3.567 + # 17.09.02³00:32³ 394116³ 414817³ 95%³ OggDS0993.exe 3.568 + # 1 2 3 4 5 3.569 + unace v -c- "$archive" | $AWK_PROG -v uuid=$(id -u -n) ' 3.570 + #only process lines starting with two numbers and a dot 3.571 + /^[0-9][0-9]\./ { 3.572 + date=substr($1,1,8) 3.573 + time=substr($1,10,5) 3.574 + #need to strip the funky little 3 off the end of size 3.575 + size=substr($3,1,(length($3)-1)) 3.576 + 3.577 + #split line at ratio and a space, second item is our name 3.578 + split($0, linesplit, ($4 " ")) 3.579 + name=linesplit[2] 3.580 + 3.581 + uid=uuid; gid=uuid; link="-"; attr="-" 3.582 + printf "%s;%s;%s;%s;%s;%s;%s;%s\n",name,size,attr,uid,gid,date,time,link 3.583 + }' 3.584 + exit 0 3.585 + fi 3.586 + done 3.587 + for ext in arj; do 3.588 + if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.589 + # format of arj output: 3.590 + # 001) ANKETA.FRG 3.591 + # 3 MS-DOS 356 121 0.340 92-04-12 11:39:46 1 3.592 + 3.593 + arj v "$archive" | $AWK_PROG -v uuid=$(id -u -n) '{ 3.594 + if (($0 ~ /^[0-9]+\) .*/)||($0 ~ /^------------ ---------- ---------- -----/)){ 3.595 + if (filestr ~ /^[0-9]+\) .*/) { 3.596 + printf "%s;%d;%s;%d;%d;%02d-%02d-%02d;%02d:%02d;%s\n", file, size, perm, uid, gid, date[1], date[3], date[2], time[1], time[2], symfile 3.597 + perm="" 3.598 + file="" 3.599 + symfile="" 3.600 + filestr="" 3.601 + } 3.602 + } 3.603 + 3.604 + if ($0 ~ /^[0-9]+\) .*/) { 3.605 + filestr=$0 3.606 + sub(/^[0-9]*\) /, "") 3.607 + file=$0 3.608 + uid=uuid 3.609 + gid=0 3.610 + } 3.611 + 3.612 + if ($0 ~ /^.* [0-9]+[\t ]+[0-9]+ [0-9]\.[0-9][0-9][0-9] [0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9].*/) { 3.613 + size=$3 3.614 + split($6, date, "-") 3.615 + split($7, time, ":") 3.616 + if ($8 ~ /^[rwx-]/) {perm=$8;} else {perm="-rw-r--r--"} 3.617 + } 3.618 + 3.619 + if ($0 ~ /^[\t ]+SymLink -> .*/) { 3.620 + symfile = $3 3.621 + perm="l"substr(perm, 2) 3.622 + } else {symfile="-"} 3.623 + 3.624 + if ($0 ~ /^[\t ]+Owner: UID [0-9]+\, GID [0-9]+/) { 3.625 + uid=$3 3.626 + gid=$5 3.627 + owner=1 3.628 + } 3.629 + }' 3.630 + exit 0 3.631 + fi 3.632 + done 3.633 + for ext in 7z; do 3.634 + if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.635 + # format of 7za output: 3.636 + # ------------------- ----- ------------ ------------ ------------ 3.637 + # 1992-04-12 11:39:46 ....A 356 ANKETA.FRG 3.638 + 3.639 + 7za l "$archive" | $AWK_PROG -v uuid=$(id -u -n) ' 3.640 + BEGIN { flag=0; } 3.641 + /^-------/ { flag++; if (flag > 1) exit 0; next } 3.642 + { 3.643 + if (flag == 0) next 3.644 + 3.645 + year=substr($1, 1, 4) 3.646 + month=substr($1, 6, 2) 3.647 + day=substr($1, 9, 2) 3.648 + time=substr($2, 1, 5) 3.649 + 3.650 + if (index($3, "D") != 0) {attr="drwxr-xr-x"} 3.651 + else if (index($3, ".") != 0) {attr="-rw-r--r--"} 3.652 + 3.653 + size=$4 3.654 + 3.655 + $0=substr($0, 54) 3.656 + if (NF > 1) {name=$0} 3.657 + else {name=$1} 3.658 + gsub(/\\/, "/", name) 3.659 + 3.660 + printf "%s;%d;%s;%d;%d;%d-%02d-%02d;%s;-\n", name, size, attr, uid, 0, year, month, day, time 3.661 + }' 3.662 + exit 0 3.663 + fi 3.664 + done 3.665 + for ext in $LHA_EXTS; do 3.666 + if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.667 + # format of lha output: 3.668 + # Desktop/up -> .. 3.669 + # lrwxrwxrwx 0/0 0 0 ****** -lhd- 0000 2009-05-03 16:59:03 [2] 3.670 + 3.671 + lha v -q -v "$archive" | $AWK_PROG ' 3.672 + { 3.673 + if ($4 == "") { 3.674 + split($0, nlsplit, " -> ") 3.675 + name=nlsplit[1] 3.676 + link=nlsplit[2] 3.677 + if (! link) {link="-"} 3.678 + next 3.679 + } 3.680 + attr=$1 3.681 + ids=$2 3.682 + split($2,ids,"/") #split up the 2nd field to get uid/gid 3.683 + uid=ids[1] 3.684 + gid=ids[2] 3.685 + size=$4 3.686 + 3.687 + year=substr($8, 1, 4) 3.688 + month=substr($8, 6, 2) 3.689 + day=substr($8, 9, 2) 3.690 + time=substr($9, 1, 5) 3.691 + 3.692 + printf "%s;%d;%s;%d;%d;%d-%02d-%02d;%s;-\n", name, size, attr, uid, gid, year, month, day, time 3.693 + }' 3.694 + exit 0 3.695 + fi 3.696 + done 3.697 exit $E_UNSUPPORTED 3.698 ;; 3.699 3.700 @@ -528,51 +629,84 @@ 3.701 update_tar_cpio add_file "$@" 3.702 for ext in $FS_EXTS; do 3.703 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.704 - loop_fs $ext add "$@" 3.705 - exit 0 3.706 + loop_fs add "$@" 3.707 fi 3.708 done 3.709 - which zip >/dev/null && for ext in $ZIP_EXTS; do 3.710 + while read exe args exts; do 3.711 + [ "$(which $exe)" ] || continue 3.712 + for ext in $exts; do 3.713 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.714 # we only want to add the file's basename, not 3.715 # the full path so... 3.716 while [ "$1" ]; do 3.717 cd "$(dirname "$1")" 3.718 - zip -g -r "$archive" "$(basename "$1")" 3.719 + $exe $args "$archive" "$(basename "$1")" 3.720 wrapper_status=$? 3.721 shift 1 3.722 done 3.723 exit $wrapper_status 3.724 fi 3.725 - done 3.726 + done 3.727 + done <<EOT 3.728 +zip -g\ -r $ZIP_EXTS 3.729 +rar a $RAR_EXTS 3.730 +arj a arj 3.731 +7za a\ -ms=off 7z 3.732 +lha a $LHA_EXTS 3.733 +EOT 3.734 exit $E_UNSUPPORTED 3.735 ;; 3.736 3.737 -n) # new: create new archive with passed files 3.738 update_tar_cpio new_archive "$@" 3.739 - which zip >/dev/null && for ext in $ZIP_EXTS; do 3.740 + while read exe args exts; do 3.741 + [ "$(which $exe)" ] || continue 3.742 + for ext in $exts; do 3.743 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.744 # create will only be passed the first file, the 3.745 # rest will be "added" to the new archive 3.746 cd "$(dirname "$1")" 3.747 - zip -r "$archive" "$(basename "$1")" 3.748 + $exe $args "$archive" "$(basename "$1")" 3.749 fi 3.750 - done 3.751 + done 3.752 + done <<EOT 3.753 +zip -r $ZIP_EXTS 3.754 +rar a $RAR_EXTS 3.755 +arj a arj 3.756 +7za a\ -ms=off 7z 3.757 +lha a $LHA_EXTS 3.758 +EOT 3.759 exit $E_UNSUPPORTED 3.760 ;; 3.761 3.762 -r) # remove: from archive passed files 3.763 update_tar_cpio remove_file "$@" 3.764 - for ext in $FS_EXTS; do 3.765 + while read exe args exts; do 3.766 + [ "$(which $exe)" ] || continue 3.767 + for ext in $exts; do 3.768 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.769 - loop_fs $ext remove "$@" 3.770 - exit 0 3.771 + $exe $args "$archive" "$@" 3.772 + exit $? 3.773 fi 3.774 - done 3.775 - which zip >/dev/null && for ext in $ZIP_EXTS; do 3.776 - if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.777 - zip -d "$archive" "$@" 3.778 - fi 3.779 + done 3.780 + done <<EOT 3.781 +loop_fs remove $FS_EXTS 3.782 +zip -d $ZIP_EXTS 3.783 +rar d $RAR_EXTS 3.784 +arj d arj 3.785 +lha d $LHA_EXTS 3.786 +EOT 3.787 + wrapper_status=0 3.788 + [ "$(which 7za)" ] && [ $(expr "$lc_archive" : ".*\.7z$") -gt 0 ] && 3.789 + while [ "$1" ]; do 3.790 + 7za l "$archive" 2>/dev/null | grep -q "[.][/]" >&/dev/null \ 3.791 + && EXFNAME=*./"$1" || EXFNAME="$1" 3.792 + 7za d "$archive" "$EXFNAME" 2>&1 \ 3.793 + | grep -q E_NOTIMPL &> /dev/null && { 3.794 + echo -e "Function not implemented: 7z cannot delete files from solid archive." >&2 3.795 + wrapper_status=$E_UNSUPPORTED 3.796 + } 3.797 + shift 1; 3.798 done 3.799 exit $E_UNSUPPORTED 3.800 ;; 3.801 @@ -587,75 +721,61 @@ 3.802 exit $? 3.803 fi 3.804 done 3.805 - for ext in $CPIO_EXTS $CPIOGZ_EXTS; do 3.806 + 3.807 + while read exe exts; do 3.808 + [ "$(which $exe)" ] || continue 3.809 + for ext in $exts; do 3.810 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.811 if [ -n "$1" ]; then 3.812 while [ "$1" ]; do 3.813 - $DECOMPRESS "$archive" | cpio -idv "$1" 3.814 + $exe "$archive" | cpio -idv "$1" 3.815 shift 1 3.816 done 3.817 else 3.818 - $DECOMPRESS "$archive" | cpio -idv 3.819 + $exe "$archive" | cpio -idv 3.820 fi 3.821 exit $? 3.822 fi 3.823 - done 3.824 - for ext in $ZIP_EXTS; do 3.825 + done 3.826 + done <<EOT 3.827 +rpm2cpio $RPM_EXTS 3.828 +do_decompress $CPIO_EXTS $CPIOGZ_EXTS 3.829 +tazpkg2cpio $TAZPKG_EXTS 3.830 +EOT 3.831 + 3.832 + while read exe args exts; do 3.833 + [ "$(which $exe)" ] || continue 3.834 + for ext in $exts; do 3.835 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.836 - # xarchive will put is the right extract dir 3.837 - # so we just have to extract. 3.838 - unzip -n "$archive" "$@" 3.839 + $exe $args "$archive" "$@" 3.840 exit $? 3.841 fi 3.842 done 3.843 - for ext in $RPM_EXTS; do 3.844 + done <<EOT 3.845 +loop_fs copy $ISO_EXTS $SQUASHFS_EXTS $CROMFS_EXTS $CLOOP_EXTS $FS_EXTS 3.846 +unzip -n $ZIP_EXTS 3.847 +dpkg-deb -X $DEB_EXTS 3.848 +lha x $LHA_EXTS 3.849 +EOT 3.850 + while read exe args argpass exts; do 3.851 + [ "$(which $exe)" ] || continue 3.852 + for ext in $exts; do 3.853 if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.854 - if [ -n "$1" ]; then 3.855 - while [ "$1" ]; do 3.856 - rpm2cpio "$archive" | cpio -idv "$1" 3.857 - shift 1 3.858 - done 3.859 - else 3.860 - rpm2cpio "$archive" | cpio -idv 3.861 - fi 3.862 - exit $? 3.863 + [ $exe != unace ] && $exe $args "$archive" "$@" 3.864 + if [ "$?" -ne "0" ] && [ "$XTERM_PROG" ]; then 3.865 + echo Probably password protected, 3.866 + echo Opening an x-terminal... 3.867 + $XTERM_PROG -e $exe $argpass "$archive" "$@" 3.868 + fi 3.869 + exit 0 3.870 fi 3.871 - done 3.872 - 3.873 - for ext in $DEB_EXTS; do 3.874 - if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.875 - dpkg-deb -X "$archive" "$@" 3.876 - exit $? 3.877 - fi 3.878 - done 3.879 - for ext in $TAZPKG_EXTS; do 3.880 - if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.881 - tmpcpio="$(mktemp -d -t cpiotmp.XXXXXX)" 3.882 - here="$(pwd)" 3.883 - cd $tmpcpio 3.884 - cpio -i < "$archive" > /dev/null 3.885 - zcat fs.cpio.gz | cpio -id > /dev/null 3.886 - status=$? 3.887 - if [ -n "$1" ]; then 3.888 - while [ "$1" ]; do 3.889 - dir=$(dirname "$here/$1") 3.890 - mkdir -p "$dir" 2> /dev/null 3.891 - mv "fs/$1" "$dir" 2> /dev/null 3.892 - done 3.893 - else 3.894 - mv fs/* fs/.* $here 2> /dev/null 3.895 - fi 3.896 - cd $here 3.897 - rm -rf $tmpcpio 3.898 - exit $status 3.899 - fi 3.900 - done 3.901 - for ext in $ISO_EXTS $SQUASHFS_EXTS $CROMFS_EXTS $CLOOP_EXTS $FS_EXTS; do 3.902 - if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then 3.903 - loop_fs $ext copy "$@" 3.904 - exit 0 3.905 - fi 3.906 - done 3.907 + done 3.908 + done <<EOT 3.909 +rar x\ -o-\ -p- x\ -o- $RAR_EXTS 3.910 +arj x\ -y x\ -y\ -g? arj 3.911 +7za x\ -y\ -p- x\ -y 7z 3.912 +unace -UNUSED- x\ -o\ -y ace 3.913 +EOT 3.914 exit $E_UNSUPPORTED 3.915 ;; 3.916
4.1 --- a/xarchive/stuff/slitaz-xarchive-wrappers-0.2.8-6.patch Sun May 03 19:37:14 2009 +0000 4.2 +++ b/xarchive/stuff/slitaz-xarchive-wrappers-0.2.8-6.patch Mon May 04 13:35:07 2009 +0200 4.3 @@ -677,3 +677,17 @@ 4.4 Exec=xarchive %F 4.5 Icon=/path/to/icons/xarchive.xpm 4.6 StartupNotify=true 4.7 + 4.8 +--- xarchive-0.2.8-6/src/main.c 4.9 ++++ xarchive-0.2.8-6/src/main.c 4.10 +@@ -178,6 +178,10 @@ 4.11 + { 4.12 + ext = (gchar *) g_ptr_array_index(wrapent->ext_array, e); 4.13 + g_string_append_printf(info_text,"%s ", ext); 4.14 ++ if (e % 10 == 9) 4.15 ++ { 4.16 ++ g_string_append_printf(info_text,"\n "); 4.17 ++ } 4.18 + } 4.19 + g_string_append_c(info_text, '\n'); 4.20 + }