ports/172621: Extend ports-mgmt/portlint with additional tests

Alan Hicks ahicks at p-o.co.uk
Fri Oct 12 00:54:29 UTC 2012


>Number:         172621
>Category:       ports
>Synopsis:       Extend ports-mgmt/portlint with additional tests
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 12 00:54:28 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Alan Hicks
>Release:        FreeBSD 9.0-RELEASE-p3 i386
>Organization:
>Environment:
System: FreeBSD schnittke.p-o.co.uk 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Tue Jun 12 01:47:53 UTC 2012 root at i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:
	
>How-To-Repeat:
empty(PORT_OPTIONS:MMYSQL) may be preferable to empty(${PORT_OPTIONS:MMYSQL})
and PORT_OPTIONS:MDOCS may be preferable to NOPORTDOCS

	
>Fix:

	
Patch adds additional tests

--- portlint.diff begins here ---
--- /usr/local/bin/portlint	2012-08-06 11:20:07.000000000 +0100
+++ /home/alan/bin/portlint	2012-10-11 17:41:24.000000000 +0100
@@ -1470,6 +1472,18 @@
 	}
 
 	#
+	# whole file: empty(${VARIABLE})
+	#
+	if ($parenwarn) {
+		print "OK: checking for empty(\${VARIABLE}).\n" if ($verbose);
+		if ($whole =~ /empty\(\${[\w\d]+/) {
+			my $lineno = &linenumber($`);
+			&perror("WARN", $file, $lineno, "use empty(VARIABLE), instead of ".
+				"empty(\${VARIABLE}).");
+		}
+	}
+
+	#
 	# whole file: use of !=
 	#
 	print "OK: checking for use of !=.\n" if ($verbose);
@@ -1775,6 +1789,12 @@
 		&perror("FATAL", $file, -1, "Both NOPORTDOCS and PORT_OPTIONS:MDOCS are found ".
 			"Remove one or another.");
 	}
+	print "OK: checking for use of NOPORTDOCS.\n" if ($verbose);
+	if ($whole =~ /NOPORTDOCS/) {
+		my $lineno = &linenumber($`);
+		&perror("WARN", $file, $lineno, "NOPORTDOCS found.  Consider ".
+			"using  PORT_OPTIONS:MDOCS");
+	}
 
 	#
 	# whole file: check for USE_GETTEXT
--- portlint.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-ports-bugs mailing list