info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: cvs add `find ./`


From: Pyatt, Scott
Subject: RE: cvs add `find ./`
Date: Fri, 6 Oct 2000 10:33:37 -0700

An optimization of this would be to perform the find from within the Perl
script.  That way the opening, compiling and closing of foo.pl happens once.
I've found that find.pl is fast under the Unix platforms I've tried but
surprisingly slow under NT.  If I need speed under NT I do something like
this:

   @findResults = `find . -type f -exec foo.pl {} \;`;

In this case "find" is from the Cygwin or MKS tools.

-Scott

-----Original Message-----
From: Richard J. Duncan [mailto:address@hidden
Sent: Friday, October 06, 2000 6:33 AM
To: address@hidden
Subject: Re: cvs add `find ./`


> Is there any way to tell CVS that I want to
> add only new files to the repository? Perhaps if
> I "cvs diff $file" and check the error level for
> each file?

One easy way is to run `cvs status <file>` and grep for "Status:
Unknown." Pipes don't work well in a find command, so I generally
write a quick script for this sort of thing:

#!/usr/local/bin/perl

# file: foo.pl

$file = shift;
open(FP,"cvs status $file|") or die "cannot run cvs status: $!";
while (<FP>) {
  if (/Status: Unknown/) {
     system "cvs add $file";
     close(FP);
     exit;
  }
}
close(FP);


Then run,

find . -type f -exec foo.pl {} \;

-Rick





_______________________________________________
Info-cvs mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/info-cvs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]