aboutsummaryrefslogtreecommitdiffstats
path: root/fix-eol
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@mandriva.org>2008-02-10 14:10:48 +0000
committerGuillaume Rousse <guillomovitch@mandriva.org>2008-02-10 14:10:48 +0000
commit845b81230df49ba65bd97d62fefc844f921a06bd (patch)
treee22dd43dbfceb07b17ed159cae001ee304817da5 /fix-eol
parenta6ece2ac948b0141008794d61084caff25938be1 (diff)
downloadspec-helper-845b81230df49ba65bd97d62fefc844f921a06bd.tar
spec-helper-845b81230df49ba65bd97d62fefc844f921a06bd.tar.gz
spec-helper-845b81230df49ba65bd97d62fefc844f921a06bd.tar.bz2
spec-helper-845b81230df49ba65bd97d62fefc844f921a06bd.tar.xz
spec-helper-845b81230df49ba65bd97d62fefc844f921a06bd.zip
standardize code for rejecting wrong files
Diffstat (limited to 'fix-eol')
-rwxr-xr-xfix-eol10
1 files changed, 6 insertions, 4 deletions
diff --git a/fix-eol b/fix-eol
index f4a7590..9648855 100755
--- a/fix-eol
+++ b/fix-eol
@@ -23,11 +23,13 @@ $exclude_pattern = qr/$exclude_pattern/;
find(\&convert, $buildroot);
sub convert {
- # reject symlinks
- return unless -f $_;
- # reject binary files
+ # skip symlinks
+ return if -l $_;
+ # skip directories
+ return if -d $_;
+ # skip binary files
return unless -T $_;
- # reject excluded files
+ # skip excluded files
return if $File::Find::name =~ $exclude_pattern;
# check if first line has less than 80 characters and ends with \r\n