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:[EMAIL PROTECTED]]
Sent: Friday, October 06, 2000 6:33 AM
To: [EMAIL PROTECTED]
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
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs

_______________________________________________
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs

Reply via email to