Subject: pkg/21841: Add ACCEPT_ALL_LICENSES to bsd.pkg.mk
To: None <gnats-bugs@gnats.netbsd.org>
From: Jonathan Perkin <sketch@rd.bbc.co.uk>
List: netbsd-bugs
Date: 06/10/2003 17:06:53
>Number:         21841
>Category:       pkg
>Synopsis:       Make it easy for users to accept all available licenses.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 10 16:07:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Jonathan Perkin
>Release:        NetBSD 1.6T
>Organization:
	British Broadcasting Corporation
>Environment:
System: NetBSD munkeh.intra.nut 1.6T NetBSD 1.6T (GENERIC) #5: Mon Jun 2 12:19:24 BST 2003 sketch@munkeh.intra.nut:/usr/obj/sys/arch/sparc64/compile/GENERIC sparc64
Architecture: sparc64
Machine: sparc64
>Description:
	Add a define for allowing users to blanket accept all licenses if they
	so wish.  The functionality already exists by way of _ACCEPTABLE,
	but that looks a bit untidy for my liking, so add this specific
	knob to twiddle.  We also get a small performance increase if users
	previously had _ACCEPTABLE but also a list of ACCEPTABLE_LICENSES, as
	we don't need to iterate through it, so wehey.
>How-To-Repeat:
>Fix:
Also at http://www.perkin.org.uk/projects/netbsd/license.patch

Index: Packages.txt
===================================================================
RCS file: /cvsroot/pkgsrc/Packages.txt,v
retrieving revision 1.294
diff -u -u -r1.294 Packages.txt
--- Packages.txt	2003/06/05 17:32:13	1.294
+++ Packages.txt	2003/06/10 15:36:11
@@ -392,7 +392,7 @@
     OBJHOSTNAME?=           yes               # use work.`hostname`
     FAILOVER_FETCH=         yes               # insist on the correct checksum
     PKG_DEVELOPER?=         yes
-    _ACCEPTABLE=            yes
+    ACCEPT_ALL_LICENSES=    yes
 
 If you wish to use xpkgwedge for the entire build, then add:
 
Index: mk/bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.1194
diff -u -u -r1.1194 bsd.pkg.mk
--- mk/bsd.pkg.mk	2003/06/10 06:01:12	1.1194
+++ mk/bsd.pkg.mk	2003/06/10 15:36:12
@@ -1133,6 +1133,10 @@
 ACCEPTABLE_LICENSES=	${ACCEPTABLE_LICENCES}
 .endif
 
+.if defined(ACCEPT_ALL_LICENCES) && !defined(ACCEPT_ALL_LICENSES)
+ACCEPT_ALL_LICENSES=	${ACCEPT_ALL_LICENCES}
+.endif
+
 ################################################################
 # Many ways to disable a package.
 #
@@ -1175,13 +1179,17 @@
 .  endif
 
 .  if defined(LICENSE)
-.    ifdef ACCEPTABLE_LICENSES
-.      for _lic in ${ACCEPTABLE_LICENSES}
-.        if ${LICENSE} == "${_lic}"
+.    if defined(ACCEPT_ALL_LICENSES)
+_ACCEPTABLE=	yes
+.    else
+.      ifdef ACCEPTABLE_LICENSES
+.        for _lic in ${ACCEPTABLE_LICENSES}
+.          if ${LICENSE} == "${_lic}"
 _ACCEPTABLE=	yes
-.        endif	# LICENSE == _lic
-.      endfor	# _lic
-.    endif	# ACCEPTABLE_LICENSES
+.          endif	# LICENSE == _lic
+.        endfor	# _lic
+.      endif	# ACCEPTABLE_LICENSES
+.    endif
 .    ifndef _ACCEPTABLE
 PKG_FAIL_REASON+= "${PKGNAME} has an unacceptable license: ${LICENSE}." \
 	 "    To build this package, add this line to your /etc/mk.conf:" \
Index: mk/bsd.pkg.defaults.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.defaults.mk,v
retrieving revision 1.153
diff -u -u -r1.153 bsd.pkg.defaults.mk
--- mk/bsd.pkg.defaults.mk	2003/06/05 12:13:34	1.153
+++ mk/bsd.pkg.defaults.mk	2003/06/10 15:36:12
@@ -159,6 +159,11 @@
 # Possible: "-Fn" where n is a number, none
 # Default: "-F0"
 
+#ACCEPT_ALL_LICENSES=
+# Blanket accept all licenses listed below.
+# Possible: defined, not defined
+# Default: not defined
+
 #ACCEPTABLE_LICENSES=	fee-based-commercial-use no-commercial-use \
 # 			no-profit limited-redistribution shareware
 # Whitespace-delimited list of the types of license which are
>Release-Note:
>Audit-Trail:
>Unformatted: