This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


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

Re: glibc CVS archive


> For those who get the sources from the CVS archive:
> 
>   The machine was reorgnaized and therefore you have to update the
>   paths.  Please don't check out the whole tree again.  This is not
>   necessary.  Just use something like this:
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> $ echo sourceware.cygnus.com:/cvs/glibc > root
> $ find libc -name Root -exec cp -f root {} \;
> $ find libc -name Repository -print | xargs sh foo
> 
> and here is the script foo:
> 
> root=`cat root` || exit; rep=${root#*:}
> 
> for f; do
> 
> case "$f" in
> /*|./*|../*) echo >&2 "$0 wants relative path from top of checkout"; exit 1;;
> esac
> 
> echo > $f $rep/${f%/CVS/Repository}
> 
> done
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
>   Roland McGrath came up with this and though I haven't tested it I trust
>   in his abilities.

You are too trusting!  That script in fact only works if your checkout
directory is called `libc' (i.e. the name of the repository module).  But
since you went and invoked my good name, here's a robust script that does
the whole job (both Root and Repository files).  (And, against my better
judgment, it uses the # and % variable features instead of sed, but
everyone probably has a shell with those features anyway.)

This script you simply invoke like this:

	sh ./da-script sourceware.cygnus.com:/cvs/glibc libc libc-2.1

where the first arg is the CVSROOT, the second arg is the module name,
and the third arg is the name of your checkout dir.

Enjoy,
Roland


#!/bin/sh

root=$1; shift
module=$1; shift
topdir=$1; shift

rep=${root#*:}

case "$topdir" in
/*|./*|../*) echo >&2 "$0 wants relative path from top of checkout"; exit 1;;
esac

find $topdir \( -name Repository -o -name Root \) -print | while read f; do

case "$f" in
*/CVS/Root) echo $root > $f ;;
*/CVS/Repository)
  r=${module}${f#${topdir}}
  echo > $f $rep/${r%/CVS/Repository}
  ;;
esac

done

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