This is the mail archive of the guile@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

How to patch your anoncvs source trees


Jim Blandy once wrote a script for patching the Root and Repository
entries in CVS trees.  It's included below.

You have to adapt the OLDROOT, OLDREP, NEWROOT and NEWREP variables
for the particular tree you are patching, cd into the top-level of
that tree and type

  relocate-wd

relocate-wd:
#!/bin/bash
#### relocate-wd --- change a working directory's repository
#   - Run the script provided below at the top of your working
#    directories, to make them point at the new rep.

OLDROOT=:ext:USER@sourceware.cygnus.com:/cvs/guile
OLDREP=/cvs/guile/guile

NEWROOT=:ext:USER@subversions.gnu.org:/cvs/guile
NEWREP=/cvs/guile/guile

## Find all the CVS control directories.
dirs=`find . -name CVS -type d -print` || exit 1

trap 'rm /tmp/oldroot' 0 1 2 15

## Make sure they're all pointing at the guile module in the old repository.
echo "$OLDROOT" > /tmp/oldroot
echo "Checking directory tree..."
for dir in $dirs; do

  ## Check the Root file.
  if [ ! -f $dir/Root ]; then
    echo "$dir doesn't have a Root!" >&1
    exit 1
  fi
  if ! cmp $dir/Root /tmp/oldroot > /dev/null; then
    echo "$dir isn't pointing at old root $OLDROOT." >&1
    exit 1
  fi
  
  ## Check the Repository file.
  if [ ! -f $dir/Repository ]; then
    echo "$dir doesn't have a Repository!" >&1
    exit 1
  fi
  if [ -n "`grep -v ^${OLDREP} $dir/Repository`" ]; then
    echo "$dir isn't pointing at old module $OLDREP." >&1
    exit 1
  fi
done

## All seems in order; change things.
echo "Frobbing tree..."
for dir in $dirs; do
  echo $NEWROOT > $dir/Root || exit 1
  sed -e "s:$OLDREP:$NEWREP:" < $dir/Repository > $dir/relocate-tmp || exit 1
  mv $dir/relocate-tmp $dir/Repository || exit 1
done

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]