ports/156164: [PATCH] ports-mgmt/portlint: modify regex that correlates WITH(OUT)_FOO with OPTIONS
Sahil Tandon
sahil at FreeBSD.org
Sun Apr 3 23:30:13 UTC 2011
>Number: 156164
>Category: ports
>Synopsis: [PATCH] ports-mgmt/portlint: modify regex that correlates WITH(OUT)_FOO with OPTIONS
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Apr 03 23:30:12 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Sahil Tandon
>Release: FreeBSD 9.0-CURRENT i386
>Organization:
>Environment:
>Description:
I ran into a problem while working on mail/postfix, whose Makefile
contains:
.if defined(WITH_DOVECOT) || defined(WITH_DOVECOT2)
Nevertheless, portlint(1) complains:
WARN: Makefile: DOVECOT2 is listed in OPTIONS, but neither WITH_DOVECOT2 nor WITHOUT_DOVECOT2 appears.
The attached patch slightly modifies the regular expression used
to check whether OPTIONS appear in WITH(OUT)_FOO. I hope this is
not something that causes breakage in other sections of the script;
but if it does, we still need another regex that gracefully handles
multiple instances of WITH(OUT)_FOO on a single line. Someone with
superior perl-fu will probably laugh heartily at my change and then
improve it considerably. :-) Thanks for taking a look.
>How-To-Repeat:
>Fix:
--- portlint.diff begins here ---
Index: src/portlint.pl
===================================================================
RCS file: /home/pcvs/ports/ports-mgmt/portlint/src/portlint.pl,v
retrieving revision 1.121
diff -u -r1.121 portlint.pl
--- src/portlint.pl 21 Mar 2011 01:00:11 -0000 1.121
+++ src/portlint.pl 3 Apr 2011 23:09:02 -0000
@@ -1541,7 +1541,7 @@
pos($whole) = 0;
print "OK: checking OPTIONS.\n" if ($verbose);
@oopt = ($makevar{OPTIONS} =~ /(\w+)\s+\".*?\"\s+\w+/sg);
- while ($whole =~ /\n[^#\n]*?\(?\s*WITH(?:OUT)?_(\w+)\s*\)?/mg) {
+ while ($whole =~ /\(?\s*WITH(?:OUT)?_(\w+)\s*\)?/mg) {
push @mopt, $1;
my $lineno = &linenumber($`) + 1;
&perror("FATAL", $file, $lineno, "option WITH(OUT)_$1 is used before ".
--- portlint.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list