[lug] cvs question

Chris Wade cwade at veripost.net
Tue Oct 9 17:16:37 MDT 2001


Thanks again.  I've been operating from the command line for months now and
I finally turned to somebody here today and said, "all right, how do I
script this stuff?"  Well, THAT opens up whole new worlds... :)

> -----Original Message-----
> From: Tom Tromey [mailto:tromey at redhat.com]
> Sent: Tuesday, October 09, 2001 5:31 PM
> To: lug at lug.boulder.co.us
> Subject: Re: [lug] cvs question
> 
> 
> >>>>> "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
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> 



More information about the LUG mailing list