From lapo@mail.lapo.it  Sun May 17 14:46:31 2009
Return-Path: <lapo@mail.lapo.it>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 149ED106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 17 May 2009 14:46:31 +0000 (UTC)
	(envelope-from lapo@mail.lapo.it)
Received: from mail.lapo.it (motoko.lapo.it [88.198.0.105])
	by mx1.freebsd.org (Postfix) with ESMTP id 625528FC1B
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 17 May 2009 14:46:29 +0000 (UTC)
	(envelope-from lapo@mail.lapo.it)
Received: (qmail 37705 invoked by uid 1001); 17 May 2009 14:46:28 -0000
Message-Id: <20090517144628.37704.qmail@mail.lapo.it>
Date: 17 May 2009 14:46:28 -0000
From: Lapo Luchini <lapo@lapo.it>
Reply-To: Lapo Luchini <lapo@lapo.it>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Lapo Luchini <lapo@lapo.it>
Subject: false positive in ports-mgmt/portlint
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         134614
>Category:       ports
>Synopsis:       false positive in ports-mgmt/portlint
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    marcus
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 17 14:50:01 UTC 2009
>Closed-Date:    Sat May 23 19:08:04 UTC 2009
>Last-Modified:  Sat May 23 19:08:04 UTC 2009
>Originator:     Lapo Luchini
>Release:        FreeBSD 6.4-STABLE amd64
>Organization:
>Environment:
System: FreeBSD motoko.lapo.it 6.4-STABLE FreeBSD 6.4-STABLE #9: Thu Jan 29 15:50:58 CET 2009 root@motoko.lapo.it:/usr/obj/usr/src/sys/MOTOKO amd64

>Description:

portlint seems to have some false positive on install-info which give a FATAL error.

>How-To-Repeat:

$ cd /usr/ports/devel/monotone
$ portlint
WARN: Makefile: [35]: possible direct use of command "rmdir" found. use ${RMDIR} instead.
WARN: Makefile: only one MASTER_SITE configured.  Consider adding additional mirrors.
FATAL: Makefile: install-info is automatically run when INFO is defined.
1 fatal error and 2 warnings found.

In fact "install-info" is only referred in that Makefile as part of a sed command.
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->marcus 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun May 17 14:50:28 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=134614 

From: Sahil Tandon <sahil@tandon.net>
To: bug-followup@FreeBSD.org
Cc: lapo@lapo.it, marcus@FreeBSD.org
Subject: Re: ports/134614: false positive in ports-mgmt/portlint
Date: Wed, 20 May 2009 21:47:49 -0400

 --mYCpIKhGyMATD0i+
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 The FATAL error misfires because of the PCRE used to identify usage of
 install-info(1).  In devel/monotone/Makefile, there is an occurrence of
 install-info-am, which is caught by the following line in portlint.pl:
 
 	if ($tmp =~ /\binstall-info\b/) {
 
 ... this is because "-" is a word boundary; but install-info(1) is not being
 called directly in the port's Makefile, which is what portlint(1) is designed
 to prevent.  I cannot think of a use case where install-info(1) would exist
 in the "prohibited sense" in the Makefile *except* when preceded by white
 space or a "/" (perhaps when the binary is called via /path/to/install-info),
 and then followed by whitespace (not another boundary char like "-").
 Perhaps I'm over thinking it, but the attached diff seems to work.  I just
 replaced the PCRE thusly:
 
 	if ($tmp =~ /[\/|\s]install-info\s/) {
 
 -- 
 Sahil Tandon <sahil@tandon.net>
 
 --mYCpIKhGyMATD0i+
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="portlint.diff"
 
 ? work
 Index: src/portlint.pl
 ===================================================================
 RCS file: /home/ncvs/ports/ports-mgmt/portlint/src/portlint.pl,v
 retrieving revision 1.108
 diff -u -r1.108 portlint.pl
 --- src/portlint.pl	13 Apr 2009 01:56:17 -0000	1.108
 +++ src/portlint.pl	21 May 2009 01:19:04 -0000
 @@ -2780,7 +2780,7 @@
  	print "OK: checking INFO.\n" if ($verbose);
  	if ($autoinfo && $tmp =~ /\nINFO=\s*([^\n]*)\n/) {
  		my @minfo = grep($_ !~ /^\s*$/, split(/\s+/, $1));
 -		if ($tmp =~ /\binstall-info\b/) {
 +		if ($tmp =~ /[\/|\s]install-info\s/) {
  			&perror("FATAL", $file, -1, "install-info is automatically run ".
  				"when INFO is defined.");
  		}
 @@ -2790,7 +2790,7 @@
  					"on files listed in the INFO macro.");
  			}
  		}
 -	} elsif ($autoinfo && $tmp =~ /\binstall-info\b/) {
 +	} elsif ($autoinfo && $tmp =~ /[\/|\s]install-info\s/) {
  		&perror("WARN", $file, -1, "do not call install-info directly.  Use the ".
  			"INFO macro instead.");
  	}
 
 --mYCpIKhGyMATD0i+--

From: Sahil Tandon <sahil@tandon.net>
To: bug-followup@FreeBSD.org
Cc: lapo@lapo.it
Subject: Re: ports/134614: false positive in ports-mgmt/portlint
Date: Wed, 20 May 2009 23:24:03 -0400

 Grr, the diff was obviously mangled in transit, but it is small enough and
 self-explanatory to still be committed if you guys find the general idea to
 be suitable.  Let me know if I should still try re-submitting.
State-Changed-From-To: open->closed 
State-Changed-By: marcus 
State-Changed-When: Sat May 23 19:07:55 UTC 2009 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=134614 
>Unformatted:
