aboutsummaryrefslogtreecommitdiff
path: root/sbolint
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2022-04-28 15:45:29 -0400
committerB. Watson <yalhcru@gmail.com>2022-04-28 15:45:29 -0400
commit8dfeeaccc2e5774f1c0650efbcf750bcc9eb1c8a (patch)
tree7314e1bf5aa05a356ded3e19de6e3523c93607b6 /sbolint
parentfb71eec28c092e3c0be866fe52cb89d2c06d9ba8 (diff)
downloadsbo-maintainer-tools-8dfeeaccc2e5774f1c0650efbcf750bcc9eb1c8a.tar.gz
sbolint: fix tarball handling, relax SlackBuild perms check. sbopkglint: recommend noarch.
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] !~ /^#!/) {