[Cialug] CVS for web projects

Matthew Nuzum matthew.nuzum at canonical.com
Wed Aug 23 10:45:48 CDT 2006


On Wed, 2006-08-23 at 09:32 -0500, Dave Weis wrote:
> Yes and no. A lot of the work is either graphics, web uploaded content, 
> and HTML. Only a small percentage is done by people at a prompt. I had 
> thought about going this direction initially but need to take small steps.
> 
> > On Aug 23, 2006, at 9:21 AM, Dave Weis wrote:
> >> I have a client that wants to use version control to keep a copy of their 
> >> site every time it's rsync'ed out to the live servers. I have it figured 
> >> out except for adding new files automatically to the repository. I don't 
> >> want a manual process to add files because it won't happen consistently and 
> >> there may be a lot of them added at any time.
> >> 
> >> Any good ideas? I was hoping not to have to parse the CVS output of the 
> >> commit and look for ? and add them separately.

It's not hard. Use cvs -q ... and you'll get fewer lines. For example:
cvs -q update -dP . | egrep '^?'

You can then pipe that through cut:
cvs -q update -dP . | egrep '^?' | cut --delimiter=' ' -f 2

You can use that as input to a for loop:
for i in `cvs -q update -dP . | egrep '^?' | cut --delimiter=' ' -f 2`
do
cvs add $i
done

Then add it all to cvs
cvs commit -m "automated add of new webfiles"

Put it all on one line:
for i in `cvs -q update -dP . | egrep '^?' | cut --delimiter=' ' -f 2`;
do cvs add $i; done && cvs commit -m "automated add of new webfiles"

-- 
Matthew Nuzum
newz2000 on freenode



More information about the Cialug mailing list