From b76a6efb4668d3fa60905a575d75ade4dcfabb85 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 30 May 2023 12:26:09 -0400 Subject: sbolint: add douninst.sh checks; sbopkglint: add hardcoded $TMP check. --- sbolint | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'sbolint') 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 -- cgit v1.2.3