Update to 2.5.9.
* Add code for formal master/slave checking rules as defined in ports/64393 [1]:
1. A port is a slave port if and only if MASTERDIR != .CURDIR
2. Slave ports should define MASTERDIR using one of the following lines:
MASTERDIR= ${.CURDIR}/../../<category>/<port>
MASTERDIR= ${.CURDIR}/../<port>
3. Non-slave ports shouldn't define MASTERDIR at all
4. The last line of a slave port's Makefile has to be
.include "${MASTERDIR}/Makefile"
5. The last line of a non-slave ports Makefile must be one of:
.include <bsd.port.mk>
.include <bsd.port.post.mk>
6. slave ports may not include bsd.port(.pre).mk
* Check to make sure MACHINE_ARCH is not defined and make sure it is never
tested directly [2]
* Fix some grammar nits [3]
PR: 64420 [1]
Submitted by: eik [1]
krion [3]
Requested by: kris [2]
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#
|
||||
|
||||
PORTNAME= portlint
|
||||
PORTVERSION= 2.5.8
|
||||
PORTVERSION= 2.5.9
|
||||
CATEGORIES= devel
|
||||
MASTER_SITES= # none
|
||||
DISTFILES= # none
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
# OpenBSD and NetBSD will be accepted.
|
||||
#
|
||||
# $FreeBSD$
|
||||
# $Id: portlint.pl,v 1.41 2004/03/10 06:25:06 marcus Exp $
|
||||
# $Id: portlint.pl,v 1.43 2004/03/21 07:31:33 marcus Exp $
|
||||
#
|
||||
|
||||
use vars qw/ $opt_a $opt_A $opt_b $opt_c $opt_h $opt_t $opt_v $opt_M $opt_N $opt_B $opt_V /;
|
||||
@@ -40,7 +40,7 @@ $portdir = '.';
|
||||
# version variables
|
||||
my $major = 2;
|
||||
my $minor = 5;
|
||||
my $micro = 8;
|
||||
my $micro = 9;
|
||||
|
||||
sub l { '[{(]'; }
|
||||
sub r { '[)}]'; }
|
||||
@@ -1045,16 +1045,6 @@ sub checkmakefile {
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# whole file: anything after bsd.port(.post).mk
|
||||
#
|
||||
print "OK: checking for anything after bsd.port(.post).mk.\n"
|
||||
if ($verbose);
|
||||
if ($whole =~ /^\.include\s+<bsd\.port(?:\.post)?\.mk>\s*[^\s]/m) {
|
||||
&perror("FATAL: $file: do not include anything after ".
|
||||
"bsd.port(.post).mk.");
|
||||
}
|
||||
|
||||
#
|
||||
# whole file: USE_* as a user-settable option
|
||||
#
|
||||
@@ -1079,6 +1069,16 @@ sub checkmakefile {
|
||||
"it is intended to be a user variable.");
|
||||
}
|
||||
|
||||
#
|
||||
# whole file: MACHINE_ARCH
|
||||
#
|
||||
print "OK: checking MACHINE_ARCH.\n" if ($verbose);
|
||||
if ($whole =~ /\nMACHINE_ARCH/) {
|
||||
my $lineno = &linenumber($`);
|
||||
&perror("FATAL: $file [$lineno]: MACHINE_ARCH should never be ".
|
||||
"overridden.");
|
||||
}
|
||||
|
||||
#
|
||||
# whole file: PKGNAME
|
||||
#
|
||||
@@ -1224,6 +1224,15 @@ pax perl printf rm rmdir ruby sed sh sort touch tr which xargs xmkmf
|
||||
"\"-p\" by default.");
|
||||
}
|
||||
|
||||
#
|
||||
# whole file: ${MACHINE_ARCH}
|
||||
#
|
||||
if ($j =~ /\${MACHINE_ARCH}\s*[!=]=/) {
|
||||
my $lineno = &linenumber($`);
|
||||
&perror("FATAL: $file [$lineno]: MACHINE_ARCH should never be tested ".
|
||||
"directly; use ARCH instead.");
|
||||
}
|
||||
|
||||
#
|
||||
# whole file: full path name
|
||||
#
|
||||
@@ -1274,14 +1283,36 @@ pax perl printf rm rmdir ruby sed sh sort touch tr which xargs xmkmf
|
||||
$slaveport = 1;
|
||||
print "OK: slave port detected, checking for inclusion of $masterdir/Makefile.\n"
|
||||
if ($verbose);
|
||||
if ($whole !~ /\n\.include\s+[<"]\$\{MASTERDIR\}\/Makefile[">]\s*$/) {
|
||||
&perror('FATAL: $file: the last line of a slave port\'s Makefile has to be'.
|
||||
if ($whole =~ /^\.\s*include\s*[<"]bsd\.port(?:\.post)?\.mk[">]/m) {
|
||||
&perror("FATAL: $file: supposedly non-slave port with".
|
||||
" .CURDIR != MASTERDIR");
|
||||
} elsif ($whole =~ /^\.\s*include\s*[<"]bsd\.port\.pre\.mk[">]/m) {
|
||||
&perror("FATAL: $file: slave ports may not include".
|
||||
" bsd.port.pre.mk");
|
||||
}
|
||||
if ($whole !~ /\n\.include\s+"\$\{MASTERDIR\}\/Makefile"\s*$/s) {
|
||||
&perror("FATAL: $file: the last line of a slave port's Makefile has to be".
|
||||
' .include "${MASTERDIR}/Makefile"');
|
||||
}
|
||||
print "OK: checking master port in $masterdir.\n" if ($verbose);
|
||||
if (! -e "$masterdir/Makefile") {
|
||||
&perror("WARN: unable to locate master port in $masterdir");
|
||||
}
|
||||
if ($whole !~ /^MASTERDIR=\s*\$\{\.CURDIR\}(?:\/\.\.){1,2}(?:\/[\w\@.+-]+){1,2}\s*$/m) {
|
||||
&perror("WARN: $file: slave ports must define MASTERDIR=".
|
||||
'${.CURDIR}/..(/../<category>)/<port>');
|
||||
}
|
||||
} else {
|
||||
#$slaveport = 0;
|
||||
print "OK: non-slave port detected, checking for anything after bsd.port(.post).mk.\n"
|
||||
if ($verbose);
|
||||
if ($whole !~ /\n\.include\s+<bsd\.port(?:\.post)?\.mk>\s*$/s) {
|
||||
&perror("FATAL: $file: the last line of Makefile has to be".
|
||||
' .include <bsd.port(.post).mk>');
|
||||
}
|
||||
if ($whole =~ /^MASTERDIR\s*[+?:!]?\s*=/m) {
|
||||
&perror("WARN: $file: non-slave ports may not define MASTERDIR");
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
@@ -1555,10 +1586,10 @@ DISTFILES DIST_SUBDIR EXTRACT_ONLY
|
||||
"number");
|
||||
} elsif ($portversion =~ /-/) {
|
||||
&perror("FATAL: $file: PORTVERSION should not contain a hyphen.".
|
||||
"should modify \"$portversion\".");
|
||||
"You should modify \"$portversion\".");
|
||||
} else {
|
||||
&perror("FATAL: $file: PORTVERSION looks illegal. ".
|
||||
"should modify \"$portversion\".");
|
||||
"You should modify \"$portversion\".");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#
|
||||
|
||||
PORTNAME= portlint
|
||||
PORTVERSION= 2.5.8
|
||||
PORTVERSION= 2.5.9
|
||||
CATEGORIES= devel
|
||||
MASTER_SITES= # none
|
||||
DISTFILES= # none
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
# OpenBSD and NetBSD will be accepted.
|
||||
#
|
||||
# $FreeBSD$
|
||||
# $Id: portlint.pl,v 1.41 2004/03/10 06:25:06 marcus Exp $
|
||||
# $Id: portlint.pl,v 1.43 2004/03/21 07:31:33 marcus Exp $
|
||||
#
|
||||
|
||||
use vars qw/ $opt_a $opt_A $opt_b $opt_c $opt_h $opt_t $opt_v $opt_M $opt_N $opt_B $opt_V /;
|
||||
@@ -40,7 +40,7 @@ $portdir = '.';
|
||||
# version variables
|
||||
my $major = 2;
|
||||
my $minor = 5;
|
||||
my $micro = 8;
|
||||
my $micro = 9;
|
||||
|
||||
sub l { '[{(]'; }
|
||||
sub r { '[)}]'; }
|
||||
@@ -1045,16 +1045,6 @@ sub checkmakefile {
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# whole file: anything after bsd.port(.post).mk
|
||||
#
|
||||
print "OK: checking for anything after bsd.port(.post).mk.\n"
|
||||
if ($verbose);
|
||||
if ($whole =~ /^\.include\s+<bsd\.port(?:\.post)?\.mk>\s*[^\s]/m) {
|
||||
&perror("FATAL: $file: do not include anything after ".
|
||||
"bsd.port(.post).mk.");
|
||||
}
|
||||
|
||||
#
|
||||
# whole file: USE_* as a user-settable option
|
||||
#
|
||||
@@ -1079,6 +1069,16 @@ sub checkmakefile {
|
||||
"it is intended to be a user variable.");
|
||||
}
|
||||
|
||||
#
|
||||
# whole file: MACHINE_ARCH
|
||||
#
|
||||
print "OK: checking MACHINE_ARCH.\n" if ($verbose);
|
||||
if ($whole =~ /\nMACHINE_ARCH/) {
|
||||
my $lineno = &linenumber($`);
|
||||
&perror("FATAL: $file [$lineno]: MACHINE_ARCH should never be ".
|
||||
"overridden.");
|
||||
}
|
||||
|
||||
#
|
||||
# whole file: PKGNAME
|
||||
#
|
||||
@@ -1224,6 +1224,15 @@ pax perl printf rm rmdir ruby sed sh sort touch tr which xargs xmkmf
|
||||
"\"-p\" by default.");
|
||||
}
|
||||
|
||||
#
|
||||
# whole file: ${MACHINE_ARCH}
|
||||
#
|
||||
if ($j =~ /\${MACHINE_ARCH}\s*[!=]=/) {
|
||||
my $lineno = &linenumber($`);
|
||||
&perror("FATAL: $file [$lineno]: MACHINE_ARCH should never be tested ".
|
||||
"directly; use ARCH instead.");
|
||||
}
|
||||
|
||||
#
|
||||
# whole file: full path name
|
||||
#
|
||||
@@ -1274,14 +1283,36 @@ pax perl printf rm rmdir ruby sed sh sort touch tr which xargs xmkmf
|
||||
$slaveport = 1;
|
||||
print "OK: slave port detected, checking for inclusion of $masterdir/Makefile.\n"
|
||||
if ($verbose);
|
||||
if ($whole !~ /\n\.include\s+[<"]\$\{MASTERDIR\}\/Makefile[">]\s*$/) {
|
||||
&perror('FATAL: $file: the last line of a slave port\'s Makefile has to be'.
|
||||
if ($whole =~ /^\.\s*include\s*[<"]bsd\.port(?:\.post)?\.mk[">]/m) {
|
||||
&perror("FATAL: $file: supposedly non-slave port with".
|
||||
" .CURDIR != MASTERDIR");
|
||||
} elsif ($whole =~ /^\.\s*include\s*[<"]bsd\.port\.pre\.mk[">]/m) {
|
||||
&perror("FATAL: $file: slave ports may not include".
|
||||
" bsd.port.pre.mk");
|
||||
}
|
||||
if ($whole !~ /\n\.include\s+"\$\{MASTERDIR\}\/Makefile"\s*$/s) {
|
||||
&perror("FATAL: $file: the last line of a slave port's Makefile has to be".
|
||||
' .include "${MASTERDIR}/Makefile"');
|
||||
}
|
||||
print "OK: checking master port in $masterdir.\n" if ($verbose);
|
||||
if (! -e "$masterdir/Makefile") {
|
||||
&perror("WARN: unable to locate master port in $masterdir");
|
||||
}
|
||||
if ($whole !~ /^MASTERDIR=\s*\$\{\.CURDIR\}(?:\/\.\.){1,2}(?:\/[\w\@.+-]+){1,2}\s*$/m) {
|
||||
&perror("WARN: $file: slave ports must define MASTERDIR=".
|
||||
'${.CURDIR}/..(/../<category>)/<port>');
|
||||
}
|
||||
} else {
|
||||
#$slaveport = 0;
|
||||
print "OK: non-slave port detected, checking for anything after bsd.port(.post).mk.\n"
|
||||
if ($verbose);
|
||||
if ($whole !~ /\n\.include\s+<bsd\.port(?:\.post)?\.mk>\s*$/s) {
|
||||
&perror("FATAL: $file: the last line of Makefile has to be".
|
||||
' .include <bsd.port(.post).mk>');
|
||||
}
|
||||
if ($whole =~ /^MASTERDIR\s*[+?:!]?\s*=/m) {
|
||||
&perror("WARN: $file: non-slave ports may not define MASTERDIR");
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
@@ -1555,10 +1586,10 @@ DISTFILES DIST_SUBDIR EXTRACT_ONLY
|
||||
"number");
|
||||
} elsif ($portversion =~ /-/) {
|
||||
&perror("FATAL: $file: PORTVERSION should not contain a hyphen.".
|
||||
"should modify \"$portversion\".");
|
||||
"You should modify \"$portversion\".");
|
||||
} else {
|
||||
&perror("FATAL: $file: PORTVERSION looks illegal. ".
|
||||
"should modify \"$portversion\".");
|
||||
"You should modify \"$portversion\".");
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user