diff options
-rwxr-xr-x | sbolint | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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 { |