aboutsummaryrefslogtreecommitdiffstats
path: root/fix_eol
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@mandriva.org>2009-05-08 16:36:18 +0000
committerGuillaume Rousse <guillomovitch@mandriva.org>2009-05-08 16:36:18 +0000
commit1b6b1bb07276cb4247e459a1472a5df55b5d6eb2 (patch)
tree3736843eb2b3d0ae6464463eae77da7b994cca31 /fix_eol
parentabf560c2b420583cef3b305037aad1a0614aa76e (diff)
downloadspec-helper-1b6b1bb07276cb4247e459a1472a5df55b5d6eb2.tar
spec-helper-1b6b1bb07276cb4247e459a1472a5df55b5d6eb2.tar.gz
spec-helper-1b6b1bb07276cb4247e459a1472a5df55b5d6eb2.tar.bz2
spec-helper-1b6b1bb07276cb4247e459a1472a5df55b5d6eb2.tar.xz
spec-helper-1b6b1bb07276cb4247e459a1472a5df55b5d6eb2.zip
fix exception handling:
- exported string is now a single regexp, as automatic dependencies exceptions - don't change directory in compress_file, so as to match absolute path easily, as $File::Find::name will always be relative to $buildroot
Diffstat (limited to 'fix_eol')
-rwxr-xr-xfix_eol10
1 files changed, 3 insertions, 7 deletions
diff --git a/fix_eol b/fix_eol
index 8634b46..4381cf5 100755
--- a/fix_eol
+++ b/fix_eol
@@ -13,12 +13,8 @@ die "Invalid build root" unless -d $buildroot;
# normalize build root
$buildroot =~ s|/$||;
-my $exclude_string = join('|',
- map { '(:?' . quotemeta($_) . ')' }
- $ENV{EXCLUDE_FROM_EOL_CONVERSION} ?
- split(' ', $ENV{EXCLUDE_FROM_EOL_CONVERSION}) : ()
-);
-my $exclude_pattern = qr/$exclude_string/;
+my $exclude_pattern = $ENV{EXCLUDE_FROM_EOL_CONVERSION} ?
+ qr/$ENV{EXCLUDE_FROM_EOL_CONVERSION}/ : undef;
find(\&convert, $buildroot);
@@ -30,7 +26,7 @@ sub convert {
# skip binary files
return unless -T $_;
# skip excluded files
- return if $exclude_string && $File::Find::name =~ $exclude_pattern;
+ return if $exclude_pattern && $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 $_: $!";