aboutsummaryrefslogtreecommitdiff
path: root/sbolint
diff options
context:
space:
mode:
Diffstat (limited to 'sbolint')
-rwxr-xr-xsbolint17
1 files changed, 12 insertions, 5 deletions
diff --git a/sbolint b/sbolint
index 7972a8f..135faf8 100755
--- a/sbolint
+++ b/sbolint
@@ -490,10 +490,10 @@ sub check_tarball_mime {
my $file = shift;
### This stuff is a little pedantic. It also relies on having a recent-ish
- ### version of GNU file (the one in Slack 14.1 works fine).
+ ### version of GNU file (the one in Slack 15.0 works fine).
my %types = (
'tar' => 'application/x-tar',
- 'tar.gz' => 'application/x-gzip',
+ 'tar.gz' => 'application/gzip',
'tar.bz2' => 'application/x-bzip2',
'tar.xz' => 'application/x-xz',
);
@@ -632,7 +632,7 @@ sub check_mode {
my $gotmode = 07777 & ((stat($file))[2]);
if($wantmode != $gotmode) {
- log_error("$file should be mode %04o, not %04o", $wantmode, $gotmode);
+ log_error("$file must be mode %04o, not %04o", $wantmode, $gotmode);
return 0;
}
@@ -657,7 +657,7 @@ sub check_and_read {
my @lines;
my $lastline_nonl;
- check_mode($file, $mode);
+ check_mode($file, $mode) if defined $mode;
if(open my $fh, "<$file") {
while(<$fh>) {
@@ -1091,7 +1091,14 @@ sub check_script {
my $file = $buildname . ".SlackBuild";
my $wantmode = $in_git_repo ? 0644 : 0755;
- my @lines = check_and_read($file, $wantmode);
+ if(-e $file) {
+ my $gotmode = 07777 & ((stat($file))[2]);
+ unless($gotmode == 0644 || (!$in_git_repo && $gotmode == 0755)) {
+ log_error("$file must have mode 644" . ($in_git_repo ? "" : " (or 0755)") . ", not %04o", $gotmode);
+ }
+ }
+
+ my @lines = check_and_read($file);
return unless scalar @lines;
if($lines[0] !~ /^#!/) {