wok diff fatattr/stuff/fatattr.sh @ rev 16815
Up gsettings-desktop-schemas (3.12.2)
author | Yuri Pourre <yuripourre@gmail.com> |
---|---|
date | Thu Jul 10 23:12:54 2014 -0300 (2014-07-10) |
parents | |
children | 46a4ae996aa7 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/fatattr/stuff/fatattr.sh Thu Jul 10 23:12:54 2014 -0300 1.3 @@ -0,0 +1,21 @@ 1.4 +#!/bin/sh 1.5 + 1.6 +ATTRS=.fatattr 1.7 + 1.8 +cdfat() { 1.9 + fatattr $1 > /dev/null && cd $1 1.10 +} 1.11 + 1.12 +case "${1/--/-}" in 1.13 +-s*) find ${3:-.} -exec fatattr {} \; > ${2:-$ATTRS} ;; 1.14 +-r*) while read line; do 1.15 + fatattr $(echo ${line:0:9} | sed 's/[^ ]/+\0 /g') "$3${line:9}" 1.16 + done < ${2:-$ATTRS} ;; 1.17 +-c*) cdfat ${2:-.} && $0 -s && find . | cpio -o -H newc ;; 1.18 +-[xe]*) cdfat ${2:-.} && cpio -idmu && $0 -r && rm -f $ATTRS ;; 1.19 +*) cat 1>&2 <<EOT 1.20 +Usage: $0 [--save|--restore] [datafile] [root] 1.21 + $0 [--create-cpio|--extract-cpio] [root] 1.22 +EOT 1.23 +esac 1.24 +