diff options
author | B. Watson <urchlay@slackware.uk> | 2023-05-30 12:26:09 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2023-05-30 12:26:09 -0400 |
commit | b76a6efb4668d3fa60905a575d75ade4dcfabb85 (patch) | |
tree | d55fe87f39b6c7782c019595a5f51370db0a3379 /sbolint | |
parent | b32fed5e41ba86761853342b88b12121f64bfe0a (diff) | |
download | sbo-maintainer-tools-b76a6efb4668d3fa60905a575d75ade4dcfabb85.tar.gz |
sbolint: add douninst.sh checks; sbopkglint: add hardcoded $TMP check.
Diffstat (limited to 'sbolint')
-rwxr-xr-x | sbolint | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -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 |