wok view fatattr/stuff/fatattr.sh @ rev 17106

transmission: add qt build dep
author Xander Ziiryanoff <psychomaniak@xakep.ru>
date Mon Sep 01 15:05:32 2014 +0200 (2014-09-01)
parents
children 46a4ae996aa7
line source
1 #!/bin/sh
3 ATTRS=.fatattr
5 cdfat() {
6 fatattr $1 > /dev/null && cd $1
7 }
9 case "${1/--/-}" in
10 -s*) find ${3:-.} -exec fatattr {} \; > ${2:-$ATTRS} ;;
11 -r*) while read line; do
12 fatattr $(echo ${line:0:9} | sed 's/[^ ]/+\0 /g') "$3${line:9}"
13 done < ${2:-$ATTRS} ;;
14 -c*) cdfat ${2:-.} && $0 -s && find . | cpio -o -H newc ;;
15 -[xe]*) cdfat ${2:-.} && cpio -idmu && $0 -r && rm -f $ATTRS ;;
16 *) cat 1>&2 <<EOT
17 Usage: $0 [--save|--restore] [datafile] [root]
18 $0 [--create-cpio|--extract-cpio] [root]
19 EOT
20 esac