aboutsummaryrefslogtreecommitdiff
path: root/sbolint
diff options
context:
space:
mode:
Diffstat (limited to 'sbolint')
-rwxr-xr-xsbolint59
1 files changed, 36 insertions, 23 deletions
diff --git a/sbolint b/sbolint
index d743339..6209f84 100755
--- a/sbolint
+++ b/sbolint
@@ -1,10 +1,14 @@
#!/usr/bin/perl -w
# note to self: keep this in sync with VER in sbopkglint and VERSION in Makefile.
-$VERSION="0.5.1";
+$VERSION="0.5.2";
# ChangeLog:
+# 0.5.2 20220702 bkw: if SlackBuild doesn't exist, skip other checks.
+
+# 0.5.1 20220702 bkw: only check junk files if checking a tarball.
+
# 20220513 bkw: starting with 0.5, moved to sbo-maintainer-tools repo.
# 0.4 20220314 bkw: add -a option to check all builds in the git repo.
@@ -79,8 +83,8 @@ with the upload form's submission checker. Lack of errors/warnings from
sbolint does not guarantee that your build will be accepted!
sbolint doesn't check built packages, and never executes the build
-script. If you want a lint tool for binary Slackware packages, try
-pprkut's B<lintpkg>.
+script. If you want a lint tool for binary Slackware packages, use
+B<sbopkglint>.
=head1 OPTIONS
@@ -267,7 +271,7 @@ B. Watson <urchlay@slackware.uk>, aka Urchlay on Libera IRC.
=head1 SEE ALSO
-B<sbofixinfo>(1), B<sbosearch>(1)
+B<sbopkglint>(1), B<sbofixinfo>(1), B<sbosearch>(1)
=cut
@@ -599,20 +603,22 @@ sub run_checks {
$buildname = `readlink -n -e .`;
$buildname =~ s,.*/,,;
- my @checks = (
- \&check_readme,
- \&check_slackdesc,
- \&check_info,
- \&check_script,
- \&check_images,
- );
-
- # if we're in a git repo, it's assumed we're going to track extra
- # files with git, and use git to update the build, not tar it up
- # and use the web form.
- push @checks, \&check_junkfiles if $checking_tarball;
- for(@checks) {
- $_->($build);
+ if(script_exists()) {
+ my @checks = (
+ \&check_readme,
+ \&check_slackdesc,
+ \&check_info,
+ \&check_script,
+ \&check_images,
+ );
+
+ # we only care about the junkfiles check for tarballs; don't
+ # try to second-guess the user otherwise.
+ push @checks, \&check_junkfiles if $checking_tarball;
+
+ for(@checks) {
+ $_->($build);
+ }
}
chdir_or_die($oldcwd);
@@ -1067,6 +1073,15 @@ sub curl_head_request {
## # and sometimes it's a different letter (r, or g, or capital V, etc).
## }
+sub script_exists {
+ my $file = $buildname . ".SlackBuild";
+ unless(-e $file) {
+ log_error("$file does not exist, this is not a valid SlackBuild dir");
+ return 0;
+ }
+ return 1;
+}
+
# NOT going to police the script too much. Would end up rewriting most of
# the shell, in perl. Plus, it'd become a straitjacket. Here's what I'll
# implement:
@@ -1086,11 +1101,9 @@ sub curl_head_request {
sub check_script {
my $file = $buildname . ".SlackBuild";
- 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 $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);