aboutsummaryrefslogtreecommitdiff
path: root/sbolint
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-06-03 06:21:02 -0400
committerB. Watson <urchlay@slackware.uk>2026-06-03 06:21:02 -0400
commite31aa5e40ce13b72343863b08e260e25daa478ec (patch)
tree26fc3c4789ec15b473996f373c34f48dc4600050 /sbolint
parent73eb4c01e8258d7e50220f30655c015791813d6a (diff)
downloadsbo-maintainer-tools-e31aa5e40ce13b72343863b08e260e25daa478ec.tar.gz
Do not enforce 755 perms on the .SlackBuild when linting a tarball.
Diffstat (limited to 'sbolint')
-rwxr-xr-xsbolint33
1 files changed, 25 insertions, 8 deletions
diff --git a/sbolint b/sbolint
index ba2df21..e34cdca 100755
--- a/sbolint
+++ b/sbolint
@@ -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 -
@@ -569,6 +569,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 +697,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 +744,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 +794,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;
@@ -1375,7 +1392,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 = ();