From 2502a010272ca823b2ca0731134c274346ec358c Mon Sep 17 00:00:00 2001 From: marcus Date: Sat, 22 Oct 2005 19:44:50 +0000 Subject: Update to 2.7.5. * Add a check for improperly quoted COMMENTs. [1] * Require quotes around all of BROKEN, FORBIDDEN, MANUAL_PACKAGE_BUILD, NO_CDROM, NO_PACKAGE, and RESTRICTED. Also, enforce the obscure rules around DEPRECATED. [2] PR: 87273 [1] 87498 [2] Submitted by: erwin [1] fenner [2] --- ports-mgmt/portlint/Makefile | 2 +- ports-mgmt/portlint/src/portlint.pl | 43 +++++++++++++++++++++++++++++++------ 2 files changed, 37 insertions(+), 8 deletions(-) (limited to 'ports-mgmt') diff --git a/ports-mgmt/portlint/Makefile b/ports-mgmt/portlint/Makefile index 2abdf192b85b..3f5da09594d1 100644 --- a/ports-mgmt/portlint/Makefile +++ b/ports-mgmt/portlint/Makefile @@ -8,7 +8,7 @@ # PORTNAME= portlint -PORTVERSION= 2.7.4 +PORTVERSION= 2.7.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 9d305eb2e794..20a32d269da1 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$ -# $MCom: portlint/portlint.pl,v 1.86 2005/10/09 18:51:51 marcus Exp $ +# $MCom: portlint/portlint.pl,v 1.89 2005/10/22 19:43:02 marcus Exp $ # use vars qw/ $opt_a $opt_A $opt_b $opt_C $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 = 7; -my $micro = 4; +my $micro = 5; sub l { '[{(]'; } sub r { '[)}]'; } @@ -1188,13 +1188,42 @@ sub checkmakefile { } # - # whole file: BROKEN + # whole file: BROKEN et al. # - print "OK: checking BROKEN.\n" if ($verbose); - if ($whole =~ /\nBROKEN[+?]?=[ \t][^"]+\w+/) { + my($var); + foreach $var qw(BROKEN FORBIDDEN MANUAL_PACKAGE_BUILD NO_CDROM NO_PACKAGE RESTRICTED) { + print "OK: checking ${var}.\n" if ($verbose); + if ($whole =~ /\n${var}[+?]?=[ \t]?[^"]+\w+/) { + my $lineno = &linenumber($`); + &perror("WARN: $file [$lineno]: ${var} messages should be ". + "quoted."); + } + } + + # + # whole file: DEPRECATED + # + print "OK: checking DEPRECATED.\n" if ($verbose); + if ($whole =~ /\nDEPRECATED[+?]?=[ \t]*"/ && + $whole !~ /\nDEPRECATED[+?]?=[ \t]*"\$\{BROKEN\}"/) { + my $lineno = &linenumber($`); + &perror("WARN: $file [$lineno]: DEPRECATED messages should not ". + "be quoted unless they are exactly \"\${BROKEN}\"."); + } + if ($whole =~ /\nDEPRECATED[+?]?=[^"]*\$\{BROKEN\}/) { my $lineno = &linenumber($`); - &perror("WARN: $file [$lineno]: BROKEN messages should be ". - "quoted."); + &perror("WARN: $file [$lineno]: \"\${BROKEN}\" must be quoted ". + "when it is the source of DEPRECATED."); + } + + # + # whole file: COMMENT + # + print "OK: checking COMMENT.\n" if ($verbose); + if ($whole =~ /^COMMENT[+?]?=[ \t]+"[^"+]"$/m) { + my $lineno = &linenumber($`); + &perror("WARN: $file [$lineno]: COMMENT messages should not ". + "be quoted."); } # -- cgit