RE: [CONTRIB] `sfind', a wrapper around `find' that ignores .svn directories
From: James FitzGibbon <jfitzgibbon_at_primustel.ca>
Date: 2005-03-03 18:13:27 CET
A simpler (though much dumber) version, if you're willing to install a
--START--use strict;
For what I usually end up using find for in working copies, it does the
Thanks
-----Original Message-----
I use this (surprisingly complicated :-( ) script constantly, and have told
I have a sneaking suspicion that it doesn't do the right thing in every
#!/usr/bin/perl -w
use strict;
# A wrapper around GNU find. It ignores Subversion cache directories,
# Subversion includes a similar tool in
my @files;
# Consume find's arguments, one by one. As soon as we see an argument
push @files , shift @ARGV while
push @expression_bits, shift @ARGV while
# We need to add `-print' if they didn't specify actions. Actions
{
# Get rid of any trailing right-parens.
push @expression_bits, qw(-print)
|| $tmp[-1] eq ";" # the last argument to `-exec' is
unshift @expression_bits, qw(( -type d -name .svn -prune ) -o);
# Let's get GNU find if possible
if ($^O =~ m(freebsd)i) {
exec ($prog, @files, @expression_bits);
-- Because he pays close attention, a Navy pilot can land a 40,000 lb. aircraft at 140 miles per hour on a pitching carrier deck, at night, more safely than the average teenager can cut a bagel. -- Paul Graham --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org For additional commands, e-mail: dev-help@subversion.tigris.org -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.5.7 - Release Date: 3/1/2005 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.5.7 - Release Date: 3/1/2005 -- ---------------------------------------------------------------------------- This electronic message contains information from Primus Telecommunications Canada Inc. ("PRIMUS") , which may be legally privileged and confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or e-mail (to the number or address above) immediately. Any views, opinions or advice expressed in this electronic message are not necessarily the views, opinions or advice of PRIMUS. It is the responsibility of the recipient to ensure that any attachments are virus free and PRIMUS bears no responsibility for any loss or damage arising in any way from the use thereof.The term "PRIMUS" includes its affiliates. ---------------------------------------------------------------------------- Pour la version en français de ce message, veuillez voir http://www.primustel.ca/fr/legal/cs.htm ---------------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org For additional commands, e-mail: dev-help@subversion.tigris.orgReceived on Thu Mar 3 18:18:46 2005 |
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.