aboutsummaryrefslogtreecommitdiff
path: root/sbolint
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2023-05-30 12:26:09 -0400
committerB. Watson <urchlay@slackware.uk>2023-05-30 12:26:09 -0400
commitb76a6efb4668d3fa60905a575d75ade4dcfabb85 (patch)
treed55fe87f39b6c7782c019595a5f51370db0a3379 /sbolint
parentb32fed5e41ba86761853342b88b12121f64bfe0a (diff)
downloadsbo-maintainer-tools-b76a6efb4668d3fa60905a575d75ade4dcfabb85.tar.gz
sbolint: add douninst.sh checks; sbopkglint: add hardcoded $TMP check.
Diffstat (limited to 'sbolint')
-rwxr-xr-xsbolint19
1 files changed, 17 insertions, 2 deletions
diff --git a/sbolint b/sbolint
index 675685f..5dbeb6d 100755
--- a/sbolint
+++ b/sbolint
@@ -1171,7 +1171,7 @@ sub check_script {
}
my $lineno = 0;
- my ($prgnam, $version, $build, $tag, $need_doinst, $slackdesc, $makepkg, $install);
+ my ($prgnam, $version, $build, $tag, $need_doinst, $need_douninst, $slackdesc, $makepkg, $install);
my ($cdpkg, $codestart, $lint_enabled, $print_pkg_name, $pkg_type, $arch_lineno);
my ($old_arch, $old_flags, $have_py2, $have_py3);
$lint_enabled = 1;
@@ -1254,6 +1254,8 @@ sub check_script {
# script dir, but they create one with >> (the jack rt audio stuff
# does this).
$need_doinst = $lineno;
+ } elsif(/^[^#]*\$\{?CWD\}?\/douninst\.sh(?:"|'|\s|>)/) {
+ $need_douninst = $lineno;
} elsif(/^[^#]*slack-desc/) {
$slackdesc = $lineno;
$install = $lineno if m,install/,; # assume OK
@@ -1382,16 +1384,29 @@ sub check_script {
log_error("$file: nothing gets installed in \$PKG/install");
}
- my $have_doinst = (-f "doinst.sh");
+ my $have_doinst = (-f "doinst.sh");
+ my $have_douninst = (-f "douninst.sh");
+
if($have_doinst) {
check_and_read("doinst.sh", 0644);
}
+
+ if($have_douninst) {
+ check_and_read("douninst.sh", 0644);
+ }
+
if($need_doinst && !$have_doinst) {
log_error("$file:$need_doinst: script installs doinst.sh, but it doesn't exist");
} elsif($have_doinst && !$need_doinst) {
log_error("$file: doinst.sh exists, but the script doesn't install it");
}
+ if($need_douninst && !$have_douninst) {
+ log_error("$file:$need_douninst: script installs douninst.sh, but it doesn't exist");
+ } elsif($have_douninst && !$need_douninst) {
+ log_error("$file: douninst.sh exists, but the script doesn't install it");
+ }
+
if($old_arch) {
# checking for the flags is supposed to let us tell the difference between
# source builds and binary repacks. since we have 30 or so old binary repack