Bug 185086 - [FEATURE-REQUEST] ports-mgmt/portlint -> consider usage of true/false
Summary: [FEATURE-REQUEST] ports-mgmt/portlint -> consider usage of true/false
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Joe Marcus Clarke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-22 11:40 UTC by hardy.schumacher
Modified: 2013-12-29 05:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hardy.schumacher 2013-12-22 11:40:00 UTC
Port ports-mgmt/portlint should determine correct usage of true/false and ${TRUE}/${FALSE}.

Issue is related to DESKTOP_ENTRIES: in case last parameter is set to true/false, portlint says:
possible direct use of command "false" found. use ${FALSE} instead.

But in case this is switched to ${TRUE}/${FALSE}, portlint says:
Use true/false instead of ${TRUE}/${FALSE} in DESKTOP_ENTRIES.

In case it is switched to $TRUE/$FALSE, portlint says:
looks fine.

Fix: 

n/a
How-To-Repeat: Take a port containing "DESKTOP_ENTRIES" and try the different versions of the last parameter as described above.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-12-22 11:40:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->marcus

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Tijl Coosemans freebsd_committer freebsd_triage 2013-12-22 14:25:26 UTC
I believe the correct use in DESKTOP_ENTRIES is "true" and "false"
(including the double quotes).
Comment 3 Joe Marcus Clarke freebsd_committer freebsd_triage 2013-12-22 16:48:43 UTC
State Changed
From-To: open->feedback

Tijl is right, though both methods work.  However, if you use "false" with 
the double-quotes, this will not trip the direct use of command check. 
Can you confirm this works for you?
Comment 4 Joe Marcus Clarke freebsd_committer freebsd_triage 2013-12-25 17:10:22 UTC
State Changed
From-To: feedback->patched

Fixed in my CVS repo pending the next release.
Comment 5 dfilter service freebsd_committer freebsd_triage 2013-12-29 05:29:18 UTC
Author: marcus
Date: Sun Dec 29 05:29:11 2013
New Revision: 337940
URL: http://svnweb.freebsd.org/changeset/ports/337940

Log:
  Update to 2.14.8.
  
  * Do not warn on direct use of "false" if it is found in DESKTOP_ENTRIES. [1]
  * Make sure the DESKTOP_ENTRIES true/false parameter does not include quotes.
  * Remove an unreferenced variable dereference. [2]
  * Add some additional variables to avoid explicit command use checks. [3]
  
  PR:		185086 [1]
  		185225 [2]
  		185110 [3]

Modified:
  head/ports-mgmt/portlint/Makefile
  head/ports-mgmt/portlint/src/portlint.pl

Modified: head/ports-mgmt/portlint/Makefile
==============================================================================
--- head/ports-mgmt/portlint/Makefile	Sun Dec 29 05:23:23 2013	(r337939)
+++ head/ports-mgmt/portlint/Makefile	Sun Dec 29 05:29:11 2013	(r337940)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	portlint
-PORTVERSION=	2.14.7
+PORTVERSION=	2.14.8
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	# none
 DISTFILES=	# none

Modified: head/ports-mgmt/portlint/src/portlint.pl
==============================================================================
--- head/ports-mgmt/portlint/src/portlint.pl	Sun Dec 29 05:23:23 2013	(r337939)
+++ head/ports-mgmt/portlint/src/portlint.pl	Sun Dec 29 05:29:11 2013	(r337940)
@@ -17,7 +17,7 @@
 # OpenBSD and NetBSD will be accepted.
 #
 # $FreeBSD$
-# $MCom: portlint/portlint.pl,v 1.297 2013/10/26 14:41:47 marcus Exp $
+# $MCom: portlint/portlint.pl,v 1.302 2013/12/29 05:26:49 marcus Exp $
 #
 
 use strict;
@@ -52,7 +52,7 @@ $portdir = '.';
 # version variables
 my $major = 2;
 my $minor = 14;
-my $micro = 7;
+my $micro = 8;
 
 sub l { '[{(]'; }
 sub r { '[)}]'; }
@@ -851,11 +851,11 @@ sub checkplist {
 			}
 		}
 
-		if ($_ =~ m{^%%PORT(\w+)%%(.*?)%%(\w+)DIR%%(.*)$} and $1 ne $3) {
+		if ($_ =~ m{^%%PORT(\w+)%%(.*?)%%(\w+)DIR%%(.*)$} and $1 ne $3 and
+			defined($check_xxxdir_ok{$3})) {
 			&perror("WARN", $file, $., "Do not mix %%PORT$1%% with %%$3DIR%%. ".
 				"Use '%%PORT$check_xxxdir_ok{$3}%%$2%%$3DIR%%$4' instead and update Makefile ".
-				"accordingly.") unless (defined($check_xxxdir_ok{$3}) and
-					$check_xxxdir_ok{$3} eq $1);
+				"accordingly.") unless ($check_xxxdir_ok{$3} eq $1);
 		}
 
 		if ($_ =~ m#man/([^/]+/)?man([$manchapters])/([^\.]+\.[$manchapters])(\.gz)?$#) {
@@ -1630,8 +1630,9 @@ sub checkmakefile {
 	#
 	print "OK: checking DESKTOP_ENTRIES for \${TRUE}/\${FALSE}.\n" if ($verbose);
 	$desktop_entries = &get_makevar_raw('DESKTOP_ENTRIES');
-	if ($desktop_entries =~ /\${TRUE}/ or $desktop_entries =~ /\${FALSE}/) {
-		&perror("FATAL", $file, -1, "Use true/false instead of \${TRUE}/\${FALSE} in DESKTOP_ENTRIES.");
+	if ($desktop_entries =~ /\${TRUE}/ or $desktop_entries =~ /\${FALSE}/ or
+	    $desktop_entries =~ /\"true\"/ or $desktop_entries =~ /\"false\"/) {
+		&perror("FATAL", $file, -1, "Use true/false (without quotes) instead of \${TRUE}/\${FALSE} in DESKTOP_ENTRIES.");
 	}
 
 	#
@@ -1893,6 +1894,11 @@ ruby sed sh sort sysctl touch tr which x
 		# lines, and go through each one.
 		while ($j =~ /^(.*$i.*)$/gm) {
 			my $curline = $1;
+			my $dte_test = $curline;
+			$dte_test =~ s/^\s+//g;
+			if ($desktop_entries =~ /$dte_test$/) {
+				next;
+			}
 			my $lineno = &linenumber($`);
 			if ($curline =~ /(?:^|\s)[\@\-]{0,2}$i(?:$|\s)/
 				&& $curline !~ /^[A-Z]+_TARGET[?+]?=[^\n]+$i/m
@@ -1905,6 +1911,8 @@ ruby sed sh sort sysctl touch tr which x
 				&& $curline !~ /^CATEGORIES(.)?=[^\n]+$i/m
 				&& $curline !~ /^USES(.)?=[^\n]+$i/m
 				&& $curline !~ /^WX_COMPS(.)?=[^\n]+$i/m
+				&& $curline !~ /^ONLY_FOR_ARCHS_REASON(.)?=[^\n]+$i/m
+				&& $curline !~ /^NOT_FOR_ARCHS_REASON(.)?=[^\n]+$i/m
 				&& $curline !~ /^\s*#.+$/m
 				&& $curline !~ /\-\-$i/m
 				&& $curline !~ /^COMMENT(.)?=[^\n]+$i/m) {
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 Joe Marcus Clarke freebsd_committer freebsd_triage 2013-12-29 05:30:08 UTC
State Changed
From-To: patched->closed

Fixed, thanks.