Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Aug 2008 00:05:24 GMT
From:      Alejandro Pulver <alepulver@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 147792 for review
Message-ID:  <200808190005.m7J05Oim066364@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=147792

Change 147792 by alepulver@alepulver_deimos on 2008/08/19 00:04:41

	- Fix saving/loading configuration.
	- Fix LICENSE_TEXT.
	- Update README's TODO list (features to test are working).
	- Modify test port to check new features.

Affected files ...

.. //depot/projects/soc2008/alepulver-portslicense/ports/Mk/README#6 edit
.. //depot/projects/soc2008/alepulver-portslicense/ports/Mk/bsd.licenses.mk#6 edit
.. //depot/projects/soc2008/alepulver-portslicense/ports/Mk/test-license-1/Makefile#3 edit

Differences ...

==== //depot/projects/soc2008/alepulver-portslicense/ports/Mk/README#6 (text+ko) ====

@@ -88,10 +88,6 @@
   to save), may require adding "ask-license" to _EXTRACT_SUSEQ (maybe
   can be done only if required, from bsd.licenses.mk)
 
-Test/fix:
-* SHA256
-* save/load maintaining other choices
-
 Maybe:
 * additional targets (show-license, show-license-report,
   show-known-licenses, etc)

==== //depot/projects/soc2008/alepulver-portslicense/ports/Mk/bsd.licenses.mk#6 (text+ko) ====

@@ -375,10 +375,6 @@
 .	elif ${_LICENSE_STATUS} == "ask"
 		@${ECHO_MSG} "===>  License ${_LICENSE} needs agreement, will ask later (by ${_LICENSE_STATUS_FROM})"
 .	endif
-.	if !defined(LICENSE_FILE) && defined(LICENSE_TEXT)
-# XXX escape shell chars?
-		@${ECHO_CMD} ${LICENSE_TEXT} > ${_LICENSE_FILE}
-.	endif
 #.else
 # XXX dual/multiple licenses
 #.endif
@@ -389,17 +385,24 @@
 _LICENSES_CONFIG=	no
 .endif
 
-# XXX Check if this works
 # For config when user accepts
 _LICENSES_ACCEPTED_YES=	${_LICENSES_ACCEPTED} ${_LICENSE}
-_LICENSES_REJECTED_YES=	${_LICENSES_REJECTED:N${_LICENSE}}
+.for lic in ${_LICENSE}
+_LICENSES_REJECTED_YES=	${_LICENSES_REJECTED:N${lic}}
+.endfor
 # For config when user rejects
-_LICENSES_ACCEPTED_NO=	${_LICENSES_ACCEPTED:N${_LICENSE}}
+.for lic in ${_LICENSE}
+_LICENSES_ACCEPTED_NO=	${_LICENSES_ACCEPTED:N${lic}}
+.endfor
 _LICENSES_REJECTED_NO=	${_LICENSES_REJECTED} ${_LICENSE}
 
 # Display, ask and save preference if requested
 
 ask-license:
+.if !defined(LICENSE_FILE) && defined(LICENSE_TEXT)
+# XXX escape shell chars?
+		@${ECHO_CMD} ${LICENSE_TEXT} > ${_LICENSE_FILE}
+.endif
 	@if [ ! -f ${_LICENSE_FILE} ]; then \
 		${ECHO_MSG} "===> License not found in \"${_LICENSE_FILE}\", aborting."; \
 		exit 1; \
@@ -438,7 +441,7 @@
 				 ${ECHO_CMD} _LICENSES_REJECTED=${_LICENSES_REJECTED_YES}; \
 				if [ ${_LICENSE_TYPE} != "known" ]; then \
 					${ECHO_CMD} _LICENSE_${_LICENSE}_CHK=`${SHA256} -q ${_LICENSE_FILE}`; \
-				fi) > ${_LICENSE_FILE}; \
+				fi) > ${_LICENSE_CFG}; \
 				${ECHO_MSG} "===> License accepted by user and saved"; \
 				status=done; \
 			fi;; \
@@ -450,7 +453,7 @@
 				 ${ECHO_CMD} _LICENSES_REJECTED=${_LICENSES_REJECTED_NO}; \
 				if [ ${_LICENSE_TYPE} != "known" ]; then \
 					${ECHO_CMD} _LICENSE_${_LICENSE}_CHK=`${SHA256} -q ${_LICENSE_FILE}`; \
-				fi) > ${_LICENSE_FILE}; \
+				fi) > ${_LICENSE_CFG}; \
 				${ECHO_MSG} "===> License rejected by user and saved"; \
 				exit 1; \
 			fi;; \

==== //depot/projects/soc2008/alepulver-portslicense/ports/Mk/test-license-1/Makefile#3 (text+ko) ====

@@ -17,16 +17,14 @@
 NO_BUILD=	yes
 NO_WRKSUBDIR=	yes
 
-LICENSE=	GPLv2
-LICENSE_FILE=	${WRKSRC}/MyFile
-#LICENSE_PERMS=	no-pkg-sell no-dist-sell
-#LICENSE_NAME=	Berkeley Software Distribution License
-#LICENSE_GROUPS=	#
-#LICENSE_PERMS=	dist-redist pkg-redist auto-accept
+LICENSE=	MyLic
+LICENSE_TEXT=	This license is at www.example.com
+LICENSE_PERMS=	redist
+LICENSE_NAME=	My Example License
+LICENSE_GROUPS=	#
 
 do-extract:
 	@${MKDIR} ${WRKDIR}
-	@${ECHO_CMD} "example" > ${LICENSE_FILE}
 
 do-install:
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808190005.m7J05Oim066364>