[Just a note that the program below seems to be missing a large chunk. I have no idea where it is so I'm just going to leave it as is in case it still turns out to be useful to anyone. -derek price] [Reprinted with permission. The speedup issue is more or less the same issue that CVSup addresses with at least somewhat the same solution (that is, assume that no files are modified in the tree one is updating). The "cvs update" could be sped up if one enables watches and modifies CVS to keep track of "cvs edit" via something other than stat()'ing each file, but why bother when "cvs commit" _knows_ the list of files being changed? -kingdon] Date: Wed, 04 Feb 1998 19:50:47 -0500 From: David Sklar Organization: Student.Net Technical Wormhole To: info-cvs@gnu.org Subject: Re: cvs & web page management We use some tools on top of CVS to manage our web tree. We use apache, so I don't know how it could work with Netscape servers. At first, we were using the technique recommended on p. 105 of the v1.9 manual to update the website automatically, namely a line in loginfo like ^cyclic-pages (date; cat; (sleep 2; cd /u/www/local-docs; cvs -q update -d) &) >> $CVSROOT/CVSROOT/updatelog 2>&1 But that scatters CVS directories all over the website and becomes painfully slow for hundreds of files. To avoid these problems, we use "cvs export" to copy out a new version of a file when it gets checked in. CVSROOT/loginfo has something like DEFAULT (cat > /tmp/cvs.exp.$USER 2>&1; (sleep 2; /www/stage.pl %s < /tmp/cvs.exp.$USER) &) The tempfile and "sleep 2" is to avoid lock-contention issues. And then /www/stage.pl parses through the output from the checkin and exports the right files. It is a little ugly because of the different ways that it could be told a file was checked in, or added, or a new directory made, etc. It looks like: -------------------------- my($cvsRoot) = '/usr/local/cvs/'; my($exportDir) = '/www/document-root'; my($fileCapture) = 0; my($files) = ""; my(@importFiles) = qw(); my(@files1) = qw(); my(@files2) = qw(); my($subDir) = ""; while() { chop; if ($_ =~ /^Log Message:/) { $fileCapture = 0; } elsif ($fileCapture) { $files .= $_; } elsif ($_ =~ /^Update of /) { $subDir = $_; $subDir =~ s/^Update of $cvsRoot//; } elsif (($_ =~ /^Modified Files:/) || ($_ =~ /^Added Files:/)) { $fileCapture = 1; } elsif ($_ =~ /^(U|N) (\S+)$/) { my $fname = $2; $fname =~ s|/+|/|g; push(@importFiles,$fname); } } # make argv[0] into a list of files if ($ARGV[0] =~ /^(\S+?) (.+)$/) { my($dir) = $1; @files1 = split(' ',$2); @files1 = map { $dir.'/'.$_ } @files1; } # make the file capture files into a list of files if ($files) { $files =~ s/\s+/ /g; $files =~ s/^\s+//g; @files2 = split(' ',$files); @files2 = map { $subDir.'/'.$_ } @files2; # if imported list is there, use that # otherwise, argv and capt list should be the same and we can use that my($fileList,@fileList); if ($#importFiles >= 0) { @fileList = @importFiles; } else { @fileList = @files1; } # # remove any existing versions of the files # unlink(map {$exportDir.'/'.$_ } @fileList); # # export the files # $fileList = join(' ',@fileList); my($output) = `cd $exportDir; umask 002; /usr/local/bin/cvs export -D now $fileList`; --------------------------- Hope this helps. If anyone has any tips for improving my yucky perl, I'd would very much like to hear them. -dave Michael Helm wrote: > > Does anyone have any experience and advice for using CVS > to manage collections of web pages? Can it cooperate with > the netscape servers for version control management? > How can cataloggers & robots be kept away from the CVS > directories? What strategies for managing web pages work? > Thanks for any discussion, ==mwh > Michael Helm (helm@fionn.es.net) > ESnet/LBNL