wok diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/fatattr/stuff/fatattr.sh	Mon Sep 01 15:05:32 2014 +0200
     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 +