diff options
Diffstat (limited to 'sbolint')
-rwxr-xr-x | sbolint | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -172,6 +172,11 @@ For all builds: =item - +The directory may not contain empty directories, empty (0-byte) files, or +hidden files/directories (named with a leading B<.>). + +=item - + The SlackBuild, .info, README files must have Unix \n line endings (not DOS \r\n), and the last line of each must have a \n. @@ -620,6 +625,7 @@ sub run_checks { \&check_info, \&check_script, \&check_images, + \&check_empty_hidden, ); # we only care about the junkfiles check for tarballs; don't @@ -1339,11 +1345,31 @@ sub check_script { } } +sub findem { + my ($findcmd, $errmsg) = @_; + open my $fh, "-|", "$findcmd"; + while(<$fh>) { + chomp; + s,^\./,,; + log_error("$errmsg: $_"); + } + close $fh; +} + +# empty/hidden files/dirs. +sub check_empty_hidden { + findem("find . -type d -a -empty", "empty directory"); + findem("find . -type f -a -empty", "empty file"); + findem("find . -type d -a -name '.*' -a ! -name . -a ! -name ..", "hidden directory"); + findem("find . -type f -a -name '.*'", "hidden file"); +} + # stuff like editor backups and dangling symlinks. # maybe *any* symlinks? # ELF objects are bad, too. # Big-ass files... # directories are OK, but hidden dirs are not. +# note that this check only gets called when checking a tarball (not a dir). sub check_junkfiles { my @sources = split(/\s+/, $info{DOWNLOAD} . " " . $info{DOWNLOAD_x86_64}); s,.*/,, for @sources; @@ -1356,7 +1382,7 @@ sub check_junkfiles { FILE: while(<$fh>) { chomp; my ($file, $type) = split /: */, $_, 2; - $file =~ s,\./,,; + $file =~ s,^\./,,; # skip the files caught by other checks next if $file eq "$buildname.SlackBuild"; |