aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@mandriva.org>2008-02-10 14:05:55 +0000
committerGuillaume Rousse <guillomovitch@mandriva.org>2008-02-10 14:05:55 +0000
commitf5380790119f1ddc42c4ffdff58c1e551e570dd6 (patch)
tree46b78acb079e65588e767a8cc6fb5e0937f275f6
parent4564130b695297a98b1de74ecbacedcc3f1474f3 (diff)
downloadspec-helper-f5380790119f1ddc42c4ffdff58c1e551e570dd6.tar
spec-helper-f5380790119f1ddc42c4ffdff58c1e551e570dd6.tar.gz
spec-helper-f5380790119f1ddc42c4ffdff58c1e551e570dd6.tar.bz2
spec-helper-f5380790119f1ddc42c4ffdff58c1e551e570dd6.tar.xz
spec-helper-f5380790119f1ddc42c4ffdff58c1e551e570dd6.zip
make EXCLUDE_FROM_EOL_CONVERSION a list of patterns, as for strip_files
-rwxr-xr-xfix-eol7
1 files changed, 4 insertions, 3 deletions
diff --git a/fix-eol b/fix-eol
index 3914afc..1480e0f 100755
--- a/fix-eol
+++ b/fix-eol
@@ -12,11 +12,12 @@ die "Invalid build root" unless -d $buildroot;
# normalize build root
$buildroot =~ s|/$||;
-my %exclude_files = (
- map { $buildroot . $_ => 1 }
+my $exclude_pattern = join('|',
+ map { '(:?' . quotemeta($_) . ')' }
$ENV{EXCLUDE_FROM_EOL_CONVERSION} ?
split(' ', $ENV{EXCLUDE_FROM_EOL_CONVERSION}) : ()
);
+$exclude_pattern = qr/$exclude_pattern/;
find(\&convert, $buildroot);
@@ -26,7 +27,7 @@ sub convert {
# reject binary files
return unless -T $_;
# reject excluded files
- return if $exclude_files{$File::Find::name};
+ return if $File::Find::name =~ $exclude_pattern;
# check if first line has less than 80 characters and ends with \r\n
open(my $in, '<', $_) or die "Unable to open file $_: $!";