diff options
| author | B. Watson <urchlay@slackware.uk> | 2023-05-14 16:59:41 -0400 | 
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2023-05-14 16:59:41 -0400 | 
| commit | 4d859d3cbfc59b45e095122f32b7fe5cea574233 (patch) | |
| tree | debf642efc837274dd18343b27d4affbe01d6957 | |
| parent | 6952280370826702b0c1cd52ef2c14f329d16ea0 (diff) | |
| download | sbo-maintainer-tools-4d859d3cbfc59b45e095122f32b7fe5cea574233.tar.gz | |
sbolint: suggest splitting combined python2+3 builds into separate ones.
| -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 { | 
