From skv@FreeBSD.org  Fri Nov  5 15:56:58 2010
Return-Path: <skv@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A90DB1065670;
	Fri,  5 Nov 2010 15:56:58 +0000 (UTC)
	(envelope-from skv@FreeBSD.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id 981178FC0A;
	Fri,  5 Nov 2010 15:56:58 +0000 (UTC)
Received: from freefall.freebsd.org (localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oA5Fuwe4014451;
	Fri, 5 Nov 2010 15:56:58 GMT
	(envelope-from skv@freefall.freebsd.org)
Received: (from skv@localhost)
	by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oA5Fuwsm014450;
	Fri, 5 Nov 2010 15:56:58 GMT
	(envelope-from skv)
Message-Id: <201011051556.oA5Fuwsm014450@freefall.freebsd.org>
Date: Fri, 5 Nov 2010 15:56:58 GMT
From: Sergey Skvortsov <skv@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: marcus@freebsd.org
Subject: [PATCH] ports-mgmt/portlint: check LICENSE and LICENSE_COMB
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         151966
>Category:       ports
>Synopsis:       [PATCH] ports-mgmt/portlint: check LICENSE and LICENSE_COMB
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    marcus
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 05 16:00:18 UTC 2010
>Closed-Date:    Sun Nov 07 22:11:38 UTC 2010
>Last-Modified:  Sun Nov 07 22:11:38 UTC 2010
>Originator:     Sergey Skvortsov
>Release:        FreeBSD 8.1-STABLE-20101015 amd64
>Organization:
>Environment:
System: FreeBSD protey.ru 8.1-STABLE-20101015 FreeBSD 8.1-STABLE-20101015 #0: Fri Oct 15 03:31:10 UTC 2010
>Description:

Added check for the case when LICENSE contains multiple tokens
but LICENSE_COMB do not set or equal to 'single' (instead of correct 'multi' or 'dual').


>How-To-Repeat:
>Fix:

--- portlint-2.13.2.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/ports-mgmt/portlint/Makefile,v
retrieving revision 1.138
diff -u -u -r1.138 Makefile
--- Makefile	5 Nov 2010 15:44:49 -0000	1.138
+++ Makefile	5 Nov 2010 15:53:25 -0000
@@ -8,8 +8,7 @@
 #
 
 PORTNAME=	portlint
-PORTVERSION=	2.13.1
-PORTREVISION=	1
+PORTVERSION=	2.13.2
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	# none
 DISTFILES=	# none
Index: src/portlint.pl
===================================================================
RCS file: /home/pcvs/ports/ports-mgmt/portlint/src/portlint.pl,v
retrieving revision 1.115
diff -u -u -r1.115 portlint.pl
--- src/portlint.pl	28 Oct 2010 21:00:15 -0000	1.115
+++ src/portlint.pl	5 Nov 2010 15:53:25 -0000
@@ -199,7 +199,7 @@
 	INDEXFILE PKGORIGIN CONFLICTS PKG_VERSION PKGINSTALLVER
 	PLIST_FILES OPTIONS INSTALLS_OMF USE_GETTEXT USE_RC_SUBR
 	DIST_SUBDIR ALLFILES IGNOREFILES CHECKSUM_ALGORITHMS INSTALLS_ICONS
-	GNU_CONFIGURE CONFIGURE_ARGS MASTER_SITE_SUBDIR
+	GNU_CONFIGURE CONFIGURE_ARGS MASTER_SITE_SUBDIR LICENSE LICENSE_COMB
 );
 
 my $cmd = join(' -V ', "make $makeenv MASTER_SITE_BACKUP=''", @varlist);
@@ -2399,6 +2399,21 @@
 		}
 	}
 
+	# check value of LICENSE_COMB
+	if (defined $makevar{LICENSE_COMB} && $makevar{LICENSE_COMB} !~ /^(single|dual|multi$)/) {
+			&perror("FATAL", $file, -1, "LICENSE_COMB contains invalid value '$1' - must be one of 'single', 'dual', 'multi'");
+	}
+
+	# check LICENSE
+	if ($makevar{LICENSE} ne '') {
+		my $comb = $makevar{LICENSE_COMB} // 'single';
+
+		my @tokens = split(/ /, $makevar{LICENSE});
+		if ($comb eq 'single' && scalar(@tokens) > 1) {
+			&perror("FATAL", $file, -1, "LICENSE contains multiple licenses but LICENSE_COMB is not set to 'dual' or 'multi'");
+		}
+	}
+
 	# check the URL
 	if (($tmp =~ /\nMASTER_SITES[+?]?=[ \t]*([^\n]*)\n/
 	 && $1 !~ /^[ \t]*$/) || ($makevar{MASTER_SITES} ne '')) {
--- portlint-2.13.2.patch ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->marcus 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Fri Nov 5 16:00:28 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=151966 
State-Changed-From-To: open->closed 
State-Changed-By: marcus 
State-Changed-When: Sun Nov 7 22:11:26 UTC 2010 
State-Changed-Why:  
Committed, thanks! 

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