diff options
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | NEWS | 19 | ||||
| -rw-r--r-- | TODO | 8 | ||||
| -rwxr-xr-x | sbodl | 2 | ||||
| -rwxr-xr-x | sbofixinfo | 2 | ||||
| -rwxr-xr-x | sbolint | 62 | ||||
| -rwxr-xr-x | sbopkglint | 2 |
7 files changed, 72 insertions, 25 deletions
@@ -1,7 +1,7 @@ PROJ=sbo-maintainer-tools # note to self: after changing this, "make version" to update all 4 scripts. -VERSION=0.9.4 +VERSION=0.9.5 PREFIX=/usr/local DESTDIR= @@ -1,10 +1,27 @@ The real ChangeLog is the git log. This is just a summary of the user-visible changes between releases. +New in 0.9.6: +============= + +sbolint: +- Stop complaining about diff/patch files that have no newline at the end. + The patch command has no problem with them. +- Patch/diff files that have CRLF line endings used to trigger an error. + This has been downgraded to a note, since in practice they no longer + cause problems like they did years ago. +- When linting a tarball, the SlackBuild's permissions are no longer + required to be 0755 (0644 is acceptable). This reflects how the + submission and approval process actually works: the script's permissions + are explictly set during the process. +- When linting a tarball, the enclosing directory is now checked for + 0755 permissions. If a tarball without +x perms for the enclosing dir + gets submitted to the site, the submission will be rejected anyway. + New in 0.9.5: ============= -sbolist: +sbolint: - Check for leading blank lines in README, which are reported as an error. - Check for trailing blank lines in README. If one is found, it's reported as a note. If more than one, it's an error. @@ -1,5 +1,13 @@ Missing argument in printf at /home/urchlay/bin/sbolint line 544, <$fh> line 2. +TODO: sbolint: error if there are no files outside of install/ and the doc dir + +TODO: promote this to an error: +___ note: package contains symlinks outside the package (which is OK, if intentional): +lrwxrwxrwx 1 root root 99 May 23 18:14 ./usr/lib64/pidgin/libgowhatsapp.so -> /home/urchlay/sbodl-cache/libgowhatsapp_0.4.1~gitb84fdd7+gowhatsapp~git64cc8cf_amd64_ubuntu18.04.so +...if the link target is /home/* or maybe if it's anything but /usr/* + +TODO: sbopkglint fails to detect install-info, see pound @ 730a4ab1f9ee3162be2c6daf910c8b064e9169cb TODO: sbolint should check for invalid characters in REQUIRES. someone had an issue with a tab character, which looked fine when editing or viewing the file... but the submission form choked on it. @@ -8,7 +8,7 @@ # 20170306 bkw: add caching # Don't edit the next line; use "make version" instead. -VERSION=0.9.4 +VERSION=0.9.5 : <<EOF =pod @@ -4,7 +4,7 @@ # companion piece to sbolint. # Don't edit the next line; use "make version" instead. -$VERSION="0.9.4"; +$VERSION="0.9.5"; =pod @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # Don't edit the next line; use "make version" instead. -$VERSION="0.9.4"; +$VERSION="0.9.5"; =pod @@ -140,7 +140,7 @@ Filename extension must match compression type. Archive must contain a directory with the same name as the archive's base name, e.g. I<foo.tar.gz> must contain I<foo/>. Everything else in the archive must be -inside this directory. +inside this directory. The directory's permissions must be 0755. =item - @@ -313,12 +313,18 @@ and correctness (must not be truncated/corrupt). Patch files (anything named *.diff or *.patch) are checked for permissions (0644) and DOS/Windows CRLF line endings. If a patch -file has CRLF endings, it B<cannot> be checked into SBo's repository, -because git will strip the CR (\r) from every line, meaning the patch -will fail to apply. In this case, the best solution is to gzip the +file has CRLF endings, it should not be checked into SBo's repository, +because git may strip the CR (\r) from every line, meaning the patch +would fail to apply. In this case, the best solution is to gzip the patch, and have the SlackBuild use e.g. "zcat $CWD/blah.diff.gz | patch -p1" to apply it. +Note that the line-ending problem only triggers a note, not a warning +or error. The trouble with git stripping \r's has become mostly a +thing of the past in recent versions of git. It's still possible for +this to happen if e.g. you're for some reason editing a SlackBuild on +a Windows machine (but why would you do that?) + =back =head1 EXIT STATUS @@ -569,6 +575,10 @@ sub chdir_or_die { chdir($_[0]) or die "$SELF: chdir($_[0]): $!\n"; } +sub get_mode { + 07777 & ((stat($_[0]))[2]); +} + sub make_temp_dir { return if $tempdir; my $tmp = $ENV{TMP} || "/tmp"; @@ -693,6 +703,15 @@ sub extract_tarball { make_temp_dir(); chdir_or_die($tempdir); system("tar xf $file"); + + # 20260602 bkw: check permissions on the enclosing dir. If it's + # not +x, the upload form will fail. + my $gotmode = get_mode("$tempdir/$buildname"); + if($gotmode != 0755) { + my $p = sprintf("%04o", $gotmode); + log_error("$file not a SBo-compliant tarball, permission of $buildname/ should be 0755, not $p."); + } + return "$tempdir/$buildname"; } @@ -731,13 +750,17 @@ sub run_checks { $in_git_repo = system("git rev-parse >/dev/null 2>/dev/null") == 0; } - # what permissions are allowed for the SlackBuild? 3 choices: - # in a tarball, it has to be 755. + # what permissions are allowed for the SlackBuild? 2 choices: # in a git repo, it has to be 644. # anywhere else, 644 and 755 are allowed. - if($checking_tarball) { - @script_perms = (0755); - } elsif($in_git_repo) { + # 20260603 bkw: this changed. we used to enforce 755 in tarballs, but + # there's no point in it: we don't use the submission tarball as the + # final downloadable file on the site. everything goes through git, + # with a git hook that changes the script perms to 0644... then when + # the update happens and the site tarballs get generated, the script + # that does that, sets the script perms to 0755. so it really doesn't + # matter what they are in the submission tarball. + if($in_git_repo) { @script_perms = (0644); } else { @script_perms = (0644, 0755); @@ -777,7 +800,7 @@ sub check_mode { return 0; } - my $gotmode = 07777 & ((stat($file))[2]); + my $gotmode = get_mode($file); if($wantmode != $gotmode) { log_error("$file must be mode %04o, not %04o", $wantmode, $gotmode); return 0; @@ -818,15 +841,14 @@ sub check_and_read { } } - if($crlf_err) { - if($file =~ /\.(diff|patch)$/i) { - log_error("$file has DOS-style CRLF line endings, git will mess it up unless you gzip it!") if $crlf_err; - } else { - log_error("$file has DOS-style CRLF line endings") if $crlf_err; - } + if($file =~ /\.(diff|patch)$/i) { + log_note("$file has DOS-style CRLF line endings, git may mess it up unless you gzip it") if $crlf_err; + # 20260523 bkw: do not complain if patches lack EOF at end! + } else { + log_error("$file has DOS-style CRLF line endings") if $crlf_err; + log_error("$file has no newline at EOF") if $lastline_nonl; } - log_error("$file has no newline at EOF") if $lastline_nonl; return @lines; } @@ -1314,7 +1336,7 @@ sub check_github_url { $dir = $tag; } elsif(@parts == 1) { $tag = $dir = $parts[0]; - if($tag =~ /^[0-9a-f]{6,}$/ && $tag !~ /^20\d{6,}/) { + if($tag =~ /^[0-9a-f]{7,}$/ && $tag !~ /^20\d{6,}/) { # commit hash. the /^20\d{6,}/ is to exclude ISO dates like 20240402 if(length($tag) < 40) { # shortened, maybe the full hash is in the filename? @@ -1376,7 +1398,7 @@ sub script_exists { sub check_script { my $file = $buildname . ".SlackBuild"; - my $gotmode = 07777 & ((stat($file))[2]); + my $gotmode = get_mode($file); my $mode_ok = 0; my @octalmodes = (); @@ -1,7 +1,7 @@ #!/bin/bash # Don't edit the next line; use "make version" instead. -VER=0.9.4 +VER=0.9.5 : <<EOF =pod |
