ports/151966: [PATCH] ports-mgmt/portlint: check LICENSE and LICENSE_COMB

Sergey Skvortsov skv at FreeBSD.org
Fri Nov 5 16:00:19 UTC 2010


>Number:         151966
>Category:       ports
>Synopsis:       [PATCH] ports-mgmt/portlint: check LICENSE and LICENSE_COMB
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 05 16:00:18 UTC 2010
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



More information about the freebsd-ports-bugs mailing list