aboutsummaryrefslogtreecommitdiffstats
path: root/ports-mgmt
diff options
context:
space:
mode:
authormarcus <marcus@FreeBSD.org>2003-10-27 05:27:30 +0800
committermarcus <marcus@FreeBSD.org>2003-10-27 05:27:30 +0800
commitb62a9b514546a0c659e951733021c03941815845 (patch)
tree5606b57e90533e1a08206387edbe93e02dfd22f1 /ports-mgmt
parenta7d700aec2b83dcd8209028af8e10120693e2605 (diff)
downloadfreebsd-ports-gnome-b62a9b514546a0c659e951733021c03941815845.tar.gz
freebsd-ports-gnome-b62a9b514546a0c659e951733021c03941815845.tar.zst
freebsd-ports-gnome-b62a9b514546a0c659e951733021c03941815845.zip
* Add some @unexec checking for plists [1]
* Check for the common typo, NOPORTSDOC [2] * Make sure .CURDIR is the primary category [3] * Check for USE_* macros that are user-settable [4] * Try to be a little more intelligent when checking for macros that need to appear earlier * Ignore make directives when checking for extra items in certain sections PR: 55921 [1] 57751 [2] 58292 [3] 58525 [4] Submitted by: edwin [1] Oliver Eikemeier <eikemeier@fillmore-labs.com> [2] [3] [4]
Diffstat (limited to 'ports-mgmt')
-rw-r--r--ports-mgmt/portlint/Makefile2
-rw-r--r--ports-mgmt/portlint/src/portlint.pl43
2 files changed, 40 insertions, 5 deletions
diff --git a/ports-mgmt/portlint/Makefile b/ports-mgmt/portlint/Makefile
index efab57476e1c..7699bd3b4e6c 100644
--- a/ports-mgmt/portlint/Makefile
+++ b/ports-mgmt/portlint/Makefile
@@ -8,7 +8,7 @@
#
PORTNAME= portlint
-PORTVERSION= 2.4.4
+PORTVERSION= 2.4.5
CATEGORIES= devel
MASTER_SITES= # none
DISTFILES= # none
diff --git a/ports-mgmt/portlint/src/portlint.pl b/ports-mgmt/portlint/src/portlint.pl
index 5e2c0c1f7697..af650b73252b 100644
--- a/ports-mgmt/portlint/src/portlint.pl
+++ b/ports-mgmt/portlint/src/portlint.pl
@@ -17,7 +17,7 @@
# OpenBSD and NetBSD will be accepted.
#
# $FreeBSD$
-# $Id: portlint.pl,v 1.16 2003/08/16 20:36:50 marcus Exp $
+# $Id: portlint.pl,v 1.18 2003/10/26 21:24:08 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 = 4;
-my $micro = 4;
+my $micro = 5;
sub l { '[{(]'; }
sub r { '[)}]'; }
@@ -444,9 +444,21 @@ sub checkplist {
if ($_ =~ /^\@/) {
if ($_ =~ /^\@(cwd|cd)[ \t]+(\S+)/) {
$curdir = $2;
+ } elsif ($_ =~ /^\@unexec[ \t]+rm[ \t]/) {
+ if ($_ !~ /%D/) {
+ &perror("WARN: pkg-plist:$. use \"%D\" to specify prefix.");
+ }
+ if ($_ !~ /true$/) {
+ &perror("WARN: pkg-plist:$. add \"2>&1 ".
+ ">/dev/null || true\" ".
+ "to \"\@unexec rm\".");
+ }
} elsif ($_ =~ /^\@unexec[ \t]+rmdir/) {
+ if ($_ !~ /%D/) {
+ &perror("WARN: pkg-plist:$. use \"%D\" to specify prefix.");
+ }
if ($_ !~ /true$/) {
- &perror("WARN: use \"\@dirrm\" ".
+ &perror("WARN: pkg-plist:$. use \"\@dirrm\" ".
"instead of \"\@unexec rmdir\".");
}
} elsif ($_ =~ /^\@exec[ \t]+scrollkeeper-install[ \t]+-q\s+(\S+)\s+.+$/) {
@@ -543,6 +555,9 @@ sub checkplist {
if ($_ =~ /^(\%\%PORTDOCS\%\%)?share\/doc\//) {
&perror("WARN: $file $.: consider using DOCSDIR macro");
+ $sharedocused++;
+ } elsif ($_ =~ /^(\%\%PORTDOCS\%\%)?\%\%DOCSDIR\%\%/) {
+ $sharedocused++;
}
if ($_ =~ /^share\/examples\//) {
@@ -844,6 +859,16 @@ sub checkmakefile {
}
#
+ # whole file: USE_* as a user-settable option
+ #
+ print "OK: checking for USE_* as a user-settable option.\n" if ($verbose);
+ while ($whole =~ /\n\s*\.\s*(?:el)?if[^\n]*?\b(\w*USE_)(\w+)(?\![^\n]*\n#?\.error)/g) {
+ &perror("WARN: is $1$2 a user-settable option? ".
+ "Consider using WITH_$2 instead.")
+ if ($1.$2 ne 'USE_GCC');
+ }
+
+ #
# whole file: NO_CHECKSUM
#
$whole =~ s/\n#[^\n]*/\n/g;
@@ -875,6 +900,9 @@ sub checkmakefile {
}
}
print "OK: checking for use of NOPORTDOCS.\n" if ($verbose);
+ if ($whole =~ /NOPORTSDOC/) {
+ &perror("WARN: NOPORTSDOC found. Do you mean NOPORTDOCS?");
+ }
if ($sharedocused && $whole !~ /defined\(NOPORTDOCS\)/
&& $whole !~ m#(\$[\{\(]PREFIX[\}\)]|$localbase)/share/doc#) {
&perror("WARN: use \".if !defined(NOPORTDOCS)\" to wrap ".
@@ -1119,6 +1147,12 @@ DISTFILES DIST_SUBDIR EXTRACT_ONLY
" if nothing seems apropriate.");
}
+ if ($committer && $makevar{'.CURDIR'} =~ m'/([^/]+)/[^/]+/?$') {
+ if ($cat[0] ne $1) {
+ &perror("FATAL: category \"$1\" must be listed first");
+ }
+ }
+
#MICHAEL: can these three lang cat checks be combined?
# skip the first category specification if it's a language specific one.
if (grep($_ eq $cat[0], @lang_cat)) {
@@ -1728,6 +1762,7 @@ sub checkextra {
$str = "\n" . $str if ($str !~ /^\n/);
$str =~ s/\n#[^\n]*/\n/g;
+ $str =~ s/\n\.[^\n]+/\n/g;
$str =~ s/\n\n+/\n/g;
$str =~ s/^\s+//;
$str =~ s/\s+$//;
@@ -1793,7 +1828,7 @@ sub checkearlier {
print "OK: checking items that has to appear earlier.\n" if ($verbose);
foreach my $i (@varnames) {
- if ($str =~ /\n$i[?+]?=/) {
+ if ($str =~ /\n$i\??=/) {
&perror("WARN: \"$i\" has to appear earlier in $file.");
}
}