Changeset 923


Ignore:
Timestamp:
Dec 1, 2009, 1:22:20 PM (11 years ago)
Author:
Peter Johansson
Message:

refs #380. Change back to --root (and -r).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/svndigest-copy-cache.as

    r922 r923  
    3232Mandatory arguments to long options are mandatory for short options too.
    3333  -h, --help            print this help and exit
    34       --source=SRC      svn wc cache is copied from
     34  -r  --root=ROOT       svn wc cache is copied from
    3535  -t, --target=TARGET   svn wc cache is copied to
    3636      --version         print version and exit
     
    5151          [--help | -h], [AS_ECHO(["$usage"]); AS_EXIT([0])],
    5252          [--version], [AS_ECHO(["$version"]); AS_EXIT([0])],
    53           [--source], [
     53          [--root | -r], [
    5454            AS_IF([test $# = 1], 
    5555                  [AS_ERROR([option `--root' needs an argument], [1])])
    5656            # restore font-lock `
    57             srcdir=$2
     57            rootdir=$2
    5858            shift
    5959          ],
    60           [--source=*], [
    61             srcdir=$optarg
     60          [--root=*], [
     61            rootdir=$optarg
    6262            shift
    6363          ],
     
    7878# set default values
    7979AS_VAR_SET_IF([targetdir],[],[targetdir=.])
    80 AS_VAR_SET_IF([srcdir],[],[srcdir=.])
     80AS_VAR_SET_IF([rootdir],[],[rootdir=.])
    8181
    8282# some simple sanity checking
    83 AS_IF([test -d "$srcdir"],[],
    84  [AS_ERROR([\`$srcdir' is not a directory], [1])])
     83AS_IF([test -d "$rootdir"],[],
     84 [AS_ERROR([\`$rootdir' is not a directory], [1])])
    8585# restore font-lock '
    8686   
     
    9696# Do the actual copying
    9797echo find files
    98 files=`cd $srcdir && find . -name "*.svndigest-cache"`
     98files=`cd $rootdir && find . -name "*.svndigest-cache"`
    9999for file in $files; do
    100100  mother=`AS_DIRNAME([$file])`
    101101  mother_base=`AS_BASENAME([$mother])`
    102102  # ignore files whose mother is not named .svndigest', which implies
    103   # we also ignore '$srcdir/foo.svndigest-cache' when $srcdir is
     103  # we also ignore '$rootdir/foo.svndigest-cache' when $rootdir is
    104104  # '.svndigest' because mother will be euqal to '.' in this
    105105  # case. This is the desired behavior because file 'foo' (which
    106   # 'foo.svndigest-cache' reflects) resides in '$srcdir/..' which
     106  # 'foo.svndigest-cache' reflects) resides in '$rootdir/..' which
    107107  # is outside the tree we are expected to copy.
    108108  AS_VAR_IF([mother_base], [.svndigest], [
     
    111111    AS_IF([test -d "$targetdir/$grandma"], [
    112112      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])
    114114    ], [
    115115      AS_ERROR([$targetdir/$grandma: No such directory], [1])
Note: See TracChangeset for help on using the changeset viewer.