aboutsummaryrefslogtreecommitdiff
path: root/sbolint
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2023-05-14 16:59:41 -0400
committerB. Watson <urchlay@slackware.uk>2023-05-14 16:59:41 -0400
commit4d859d3cbfc59b45e095122f32b7fe5cea574233 (patch)
treedebf642efc837274dd18343b27d4affbe01d6957 /sbolint
parent6952280370826702b0c1cd52ef2c14f329d16ea0 (diff)
downloadsbo-maintainer-tools-4d859d3cbfc59b45e095122f32b7fe5cea574233.tar.gz
sbolint: suggest splitting combined python2+3 builds into separate ones.
Diffstat (limited to 'sbolint')
-rwxr-xr-xsbolint14
1 files changed, 13 insertions, 1 deletions
diff --git a/sbolint b/sbolint
index fd761ae..9062969 100755
--- a/sbolint
+++ b/sbolint
@@ -1195,7 +1195,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, $pkg_type, $arch_lineno);
- my ($old_arch, $old_flags);
+ my ($old_arch, $old_flags, $have_py2, $have_py3);
$lint_enabled = 1;
for(@lines) {
@@ -1340,6 +1340,14 @@ sub check_script {
if(/^[^#]*\bpython\b/) {
log_note("$file:$lineno: suggest replacing 'python' with 'python2' for future-proofing");
}
+
+ if(/^[^#]*\bpython2?\b/) {
+ $have_py2 = $lineno;
+ }
+
+ if(/^[^#]*\bpython3?\b/) {
+ $have_py3 = $lineno;
+ }
}
if(not defined($prgnam)) {
@@ -1416,6 +1424,10 @@ sub check_script {
} elsif($old_flags) {
log_error("$file:$old_flags: archaic -march= compiler flag (we support i586 and up)");
}
+
+ if($have_py2 && $have_py3) {
+ log_note("$file: it looks like this build includes both python2 and python3 code. consider splitting it into separate python2- and python3- builds.");
+ }
}
sub findem {