diff options
author | Guillaume Rousse <guillomovitch@mandriva.org> | 2008-02-10 14:05:55 +0000 |
---|---|---|
committer | Guillaume Rousse <guillomovitch@mandriva.org> | 2008-02-10 14:05:55 +0000 |
commit | f5380790119f1ddc42c4ffdff58c1e551e570dd6 (patch) | |
tree | 46b78acb079e65588e767a8cc6fb5e0937f275f6 /fix-eol | |
parent | 4564130b695297a98b1de74ecbacedcc3f1474f3 (diff) | |
download | spec-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
Diffstat (limited to 'fix-eol')
-rwxr-xr-x | fix-eol | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 $_: $!"; |