aboutsummaryrefslogtreecommitdiff
path: root/sbolint
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2023-02-04 04:52:30 -0500
committerB. Watson <urchlay@slackware.uk>2023-02-04 04:52:30 -0500
commitd6083f48ab92a3517f97a3aa888747a441ae62d8 (patch)
tree1c93c5a704fe9958e70bd6f6dcec7a99647199dc /sbolint
parent7e1fdf08468a7cee4fdbcf18cd80287a662d2f22 (diff)
downloadsbo-maintainer-tools-d6083f48ab92a3517f97a3aa888747a441ae62d8.tar.gz
sbolint: detect PRINT_PACKAGE_NAME issues.
Diffstat (limited to 'sbolint')
-rwxr-xr-xsbolint23
1 files changed, 20 insertions, 3 deletions
diff --git a/sbolint b/sbolint
index b98ee08..0a67943 100755
--- a/sbolint
+++ b/sbolint
@@ -1131,7 +1131,7 @@ sub check_script {
my $lineno = 0;
my ($prgnam, $version, $build, $tag, $need_doinst, $slackdesc, $makepkg, $install);
- my ($cdpkg, $codestart, $lint_enabled, $print_pkg_name);
+ my ($cdpkg, $codestart, $lint_enabled, $print_pkg_name, $pkg_type, $arch_lineno);
$lint_enabled = 1;
for(@lines) {
@@ -1227,7 +1227,16 @@ sub check_script {
# 20220312 bkw: 15.0 template
if(/^[^#]*\$.*PRINT_PACKAGE_NAME/) {
- $print_pkg_name = 1;
+ $print_pkg_name = $lineno;
+ }
+
+ # 20230204 bkw: more 15.0 template
+ if(/^PKGTYPE=/) {
+ $pkg_type = $lineno;
+ }
+
+ if((not defined $arch_lineno) && (/\bARCH=/)) {
+ $arch_lineno = $lineno;
}
}
@@ -1255,7 +1264,15 @@ sub check_script {
log_error("$file: no makepkg command found");
}
- if(not defined($print_pkg_name)) {
+ # 20230204 bkw: better support for 15.0 template.
+ if(defined($print_pkg_name)) {
+ if((!defined $pkg_type) || ($pkg_type > $print_pkg_name)) {
+ log_error("$file: PKGTYPE not defined before PRINT_PACKAGE_NAME stanza (Slackware >= 15.0)");
+ }
+ if((!defined $arch_lineno) || ($arch_lineno > $print_pkg_name)) {
+ log_error("$file: ARCH not defined before PRINT_PACKAGE_NAME stanza (Slackware >= 15.0)");
+ }
+ } else {
log_error("$file: missing PRINT_PACKAGE_NAME stanza (Slackware >= 15.0)");
}