wok rev 17549

fatattr: fix fatattr.sh --restore
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jan 29 15:49:38 2015 +0100 (2015-01-29)
parents 705629de834c
children 76ff15b5d3ea
files fatattr/stuff/fatattr.sh
line diff
     1.1 --- a/fatattr/stuff/fatattr.sh	Thu Jan 29 13:01:35 2015 +0100
     1.2 +++ b/fatattr/stuff/fatattr.sh	Thu Jan 29 15:49:38 2015 +0100
     1.3 @@ -8,9 +8,8 @@
     1.4  
     1.5  case "${1/--/-}" in
     1.6  -s*)	find ${3:-.} -exec fatattr {} \; > ${2:-$ATTRS} ;;
     1.7 --r*)	while read line; do
     1.8 -		fatattr	$(echo ${line:0:9} | sed 's/[^ ]/+\0 /g') "$3${line:9}"
     1.9 -	done < ${2:-$ATTRS} ;;
    1.10 +-r*)	sed -e 's/^\(.\{0,8\}\)/\1=/' -e ':a;s/^\([^ =]*\)\ /\1/;ta' \
    1.11 +	    -e 's/^/fatattr +/;s/=//' < ${2:-$ATTRS} | sh ;;
    1.12  -c*)	cdfat ${2:-.} && $0 -s && find . | cpio -o -H newc ;;
    1.13  -[xe]*)	cdfat ${2:-.} && cpio -idmu && $0 -r && rm -f $ATTRS ;;
    1.14  *)	cat 1>&2 <<EOT