[CONTRIB] `sfind', a wrapper around `find' that ignores .svn directories
From: Eric Hanchrow <offby1_at_blarg.net>
Date: 2005-03-03 17:28:55 CET
I use this (surprisingly complicated :-( ) script constantly, and have
I have a sneaking suspicion that it doesn't do the right thing in
#!/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 (@ARGV && $ARGV[0] !~ m{^[-(!]});
push @expression_bits, shift @ARGV while (@ARGV);
# 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.orgReceived on Thu Mar 3 17:59:29 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.