[lug] cvs question

Tom Tromey tromey at redhat.com
Tue Oct 9 17:31:23 MDT 2001


>>>>> "Chris" == Chris Wade <cwade at veripost.net> writes:

Chris> Thanks!  I don't want to sound like a total idiot, but it's the
Chris> bash scripting part I don't know how to do... could you give me
Chris> an example of what a script like that would look like?

I haven't tested this.
It runs too many `cvs add's, but that doesn't matter.
There are more efficient approaches.  This one is simple.
This works best if you use a fresh copy of each tree.


trunk=/path/to/trunk
branch=/path/to/branch

# Remove files that need removing.
cd $trunk
find . -type f -print |
fgrep -v CVS |
while read f; do
  if ! test -f $branch/$f; then
    cvs rm $f
  fi
done

# Copy files over and cvs add them.
cd $branch
find . -type f -print |
fgrep -v CVS |
(cd $trunk
while read f; do
  cp $branch/$f $f
  cvs add $f
done
)

Tom



More information about the LUG mailing list