X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=x2p%2Ffind2perl.PL;h=5add931397aa4741b1e0e3f3180523506c2a66f6;hb=953f6acfa20ec275ec39a552dfac8124bd93ebdf;hp=b99bb498637d44de2c622b876c102176da454202;hpb=a9a4ee8b12bbb03d4563807d9b09f3f7262a7701;p=p5sagit%2Fp5-mst-13.2.git diff --git a/x2p/find2perl.PL b/x2p/find2perl.PL index b99bb49..5add931 100644 --- a/x2p/find2perl.PL +++ b/x2p/find2perl.PL @@ -99,8 +99,10 @@ while (@ARGV) { } elsif ($_ eq '!') { $out .= tab . "!"; next; - } elsif ($_ eq 'name') { - $out .= tab . '/' . fileglob_to_re(shift) . "/s"; + } elsif (/^(i)?name$/) { + $out .= tab . '/' . fileglob_to_re(shift) . "/s$1"; + } elsif (/^(i)?path$/) { + $out .= tab . '$File::Find::name =~ /' . fileglob_to_re(shift) . "/s$1"; } elsif ($_ eq 'perm') { my $onum = shift; $onum =~ /^-?[0-7]+$/ @@ -266,7 +268,9 @@ while (@ARGV) { } if ($print_needed) { - $out .= "\n" . tab . '&& print("$name\n")'; + my $t = tab; + if ($t !~ /&&\s*$/) { $t .= '&& ' } + $out .= "\n" . $t . 'print("$name\n")'; } @@ -781,6 +785,18 @@ File name matches specified GLOB wildcard pattern. GLOB may need to be quoted to avoid interpretation by the shell (just as with using C). +=item C<-iname GLOB> + +Like C<-name>, but the match is case insensitive. + +=item C<-path GLOB> + +Path name matches specified GLOB wildcard pattern. + +=item C<-ipath GLOB> + +Like C<-path>, but the match is case insensitive. + =item C<-perm PERM> Low-order 9 bits of permission match octal value PERM. @@ -826,7 +842,7 @@ True if (hard) link count of file matches N (see below). True if file's size matches N (see below) N is normally counted in 512-byte blocks, but a suffix of "c" specifies that size should be -counted in characters (bytes) and a suffix of "k" specifes that +counted in characters (bytes) and a suffix of "k" specifies that size should be counted in 1024-byte blocks. =item C<-atime N>