Changeset 923
- Timestamp:
- Dec 1, 2009, 1:22:20 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/svndigest-copy-cache.as
r922 r923 32 32 Mandatory arguments to long options are mandatory for short options too. 33 33 -h, --help print this help and exit 34 --source=SRCsvn wc cache is copied from34 -r --root=ROOT svn wc cache is copied from 35 35 -t, --target=TARGET svn wc cache is copied to 36 36 --version print version and exit … … 51 51 [--help | -h], [AS_ECHO(["$usage"]); AS_EXIT([0])], 52 52 [--version], [AS_ECHO(["$version"]); AS_EXIT([0])], 53 [-- source], [53 [--root | -r], [ 54 54 AS_IF([test $# = 1], 55 55 [AS_ERROR([option `--root' needs an argument], [1])]) 56 56 # restore font-lock ` 57 srcdir=$257 rootdir=$2 58 58 shift 59 59 ], 60 [-- source=*], [61 srcdir=$optarg60 [--root=*], [ 61 rootdir=$optarg 62 62 shift 63 63 ], … … 78 78 # set default values 79 79 AS_VAR_SET_IF([targetdir],[],[targetdir=.]) 80 AS_VAR_SET_IF([ srcdir],[],[srcdir=.])80 AS_VAR_SET_IF([rootdir],[],[rootdir=.]) 81 81 82 82 # some simple sanity checking 83 AS_IF([test -d "$ srcdir"],[],84 [AS_ERROR([\`$ srcdir' is not a directory], [1])])83 AS_IF([test -d "$rootdir"],[], 84 [AS_ERROR([\`$rootdir' is not a directory], [1])]) 85 85 # restore font-lock ' 86 86 … … 96 96 # Do the actual copying 97 97 echo find files 98 files=`cd $ srcdir && find . -name "*.svndigest-cache"`98 files=`cd $rootdir && find . -name "*.svndigest-cache"` 99 99 for file in $files; do 100 100 mother=`AS_DIRNAME([$file])` 101 101 mother_base=`AS_BASENAME([$mother])` 102 102 # ignore files whose mother is not named .svndigest', which implies 103 # we also ignore '$ srcdir/foo.svndigest-cache' when $srcdir is103 # we also ignore '$rootdir/foo.svndigest-cache' when $rootdir is 104 104 # '.svndigest' because mother will be euqal to '.' in this 105 105 # case. This is the desired behavior because file 'foo' (which 106 # 'foo.svndigest-cache' reflects) resides in '$ srcdir/..' which106 # 'foo.svndigest-cache' reflects) resides in '$rootdir/..' which 107 107 # is outside the tree we are expected to copy. 108 108 AS_VAR_IF([mother_base], [.svndigest], [ … … 111 111 AS_IF([test -d "$targetdir/$grandma"], [ 112 112 AS_MKDIR_P(["$targetdir/$mother"]) 113 cp -v "$ srcdir/$file" "$targetdir/$file" || AS_EXIT([1])113 cp -v "$rootdir/$file" "$targetdir/$file" || AS_EXIT([1]) 114 114 ], [ 115 115 AS_ERROR([$targetdir/$grandma: No such directory], [1])
Note: See TracChangeset
for help on using the changeset viewer.