From 73b04b963c2311f54a29ced60ba87edb1176f2fe Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 15 Mar 2017 03:27:32 -0400 Subject: sbolint git repo support, warn if build logs found --- sbolint | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'sbolint') diff --git a/sbolint b/sbolint index 0b9c794..4577f1f 100755 --- a/sbolint +++ b/sbolint @@ -119,8 +119,8 @@ For all builds: =item - -The SlackBuild script must exist, with mode 0755, and be a I<#!/bin/sh> -script. +The SlackBuild script must exist, with mode 0755 (or 0644, if in a git repo), +and be a I<#!/bin/sh> script. =item - @@ -198,6 +198,11 @@ checked for permissions (should be 0644) and excessive size. The source archive(s) must not exist. Also sbolint attempts to detect extracted source trees (but isn't all that good at it). +=item - + +Files named 'build.log' or 'strace.out*' must not exist. The B +tool creates these. + =back =head1 EXIT STATUS @@ -880,7 +885,15 @@ sub curl_head_request { sub check_script { my $file = $buildname . ".SlackBuild"; - my @lines = check_and_read($file, 0755); + my $wantmode = 0755; + + # are we in a git repo? build scripts are mode 0644 there. + my $got = system("git status >/dev/null 2>/dev/null"); + if($got == 0) { + $wantmode = 0644; + } + + my @lines = check_and_read($file, $wantmode); return unless scalar @lines; if($lines[0] !~ /^#/) { @@ -1025,6 +1038,10 @@ sub check_junkfiles { log_warning("$file looks like sort some of backup file"); next FILE; }; + /^(?:build.log|strace.out)/ && do { + log_warning("$file is a build log"); + next FILE; + }; /\.desktop$/ && do { system("desktop-file-validate $file"); if($? != 0) { -- cgit v1.2.3