Update to 2.17.11.

* Trim comments after USE_GCC [1]
* Add a check for redundant SHEBANG_LANG values [2]
* Make sure both USES and USE_* are actually seen before checking
  to see if one is included before the other [3]

PR:		221085 [1]
		220500 [2]
Submitted by:	gerald [1]
Reported by:	dbaio [3]
This commit is contained in:
Joe Marcus Clarke 2017-08-03 12:55:02 +00:00
parent 12897e814a
commit 7fd91ebc31
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=447208
2 changed files with 19 additions and 6 deletions

View file

@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= portlint
PORTVERSION= 2.17.10
PORTVERSION= 2.17.11
CATEGORIES= ports-mgmt
MASTER_SITES= # none
DISTFILES= # none

View file

@ -15,7 +15,7 @@
# was removed.
#
# $FreeBSD$
# $MCom: portlint/portlint.pl,v 1.413 2017/07/22 01:46:20 jclarke Exp $
# $MCom: portlint/portlint.pl,v 1.417 2017/08/03 12:52:43 jclarke Exp $
#
use strict;
@ -50,7 +50,7 @@ $portdir = '.';
# version variables
my $major = 2;
my $minor = 17;
my $micro = 10;
my $micro = 11;
# default setting - for FreeBSD
my $portsdir = '/usr/ports';
@ -159,7 +159,7 @@ my @varlist = qw(
OPTIONS_GROUP OPTIONS_SUB INSTALLS_OMF USE_RC_SUBR USES DIST_SUBDIR
ALLFILES CHECKSUM_ALGORITHMS INSTALLS_ICONS GNU_CONFIGURE
CONFIGURE_ARGS MASTER_SITE_SUBDIR LICENSE LICENSE_COMB NO_STAGE
DEVELOPER SUB_FILES
DEVELOPER SUB_FILES SHEBANG_LANG
);
my %makevar;
@ -230,7 +230,7 @@ while (my $mline = <MK>) {
}
}
}
if ($uulineno < $ulineno) {
if ($uulineno > -1 && $ulineno > -1 && $uulineno < $ulineno) {
&perror("WARN", 'Makefile', $uulineno, "USE_* seen before USES. ".
"According to the porters-handbook, USES must appear first.");
}
@ -2175,7 +2175,7 @@ xargs xmkmf
#
# whole file: USE_GCC checks
#
if ($whole =~ /^USE_GCC[?:]?=\s*(.*)$/m) {
if ($whole =~ /^USE_GCC[?:]?=\s*([^\s#]*).*$/m) {
my $lineno = &linenumber($`);
my $gcc_val = $1;
if ($gcc_val eq 'any' || $gcc_val eq 'yes') {
@ -2268,6 +2268,19 @@ xargs xmkmf
"bsd.port.mk.");
}
#
# whole file: check for redundant SHEBANG_LANGs
#
if ($whole =~ /\nSHEBANG_LANG[?+]?=\s*([^\s#]*).*\n/) {
my @shebang_langs = split(/\s+/, $1 // '');
foreach my $shebang_lang (@shebang_langs) {
if ($makevar{SHEBANG_LANG} =~ /\b$shebang_lang\b/) {
&perror("WARN", $file, -1, "$shebang_lang is already included in ".
"SHEBANG_LANG. You should remove this from $file.");
}
}
}
#
# whole file: CONFIGURE_ENV
#