Date: Mon, 18 Aug 2008 23:51:09 GMT From: Alejandro Pulver <alepulver@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 147790 for review Message-ID: <200808182351.m7INp9VI064085@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=147790 Change 147790 by alepulver@alepulver_deimos on 2008/08/18 23:50:52 - Move licenses database (placeholder for FOSSology's db) to a separate file bsd.licenses.db.mk. - Update README's TODO list. - Update comments in bsd.licenses.mk. - Add code to keep previous configuration when saving. Affected files ... .. //depot/projects/soc2008/alepulver-portslicense/ports/Mk/README#5 edit .. //depot/projects/soc2008/alepulver-portslicense/ports/Mk/bsd.licenses.db.mk#1 add .. //depot/projects/soc2008/alepulver-portslicense/ports/Mk/bsd.licenses.mk#5 edit Differences ... ==== //depot/projects/soc2008/alepulver-portslicense/ports/Mk/README#5 (text+ko) ==== @@ -81,25 +81,22 @@ -> 2 nested loops are needed, and 2 scans: 1 for "license combinations" (OR), containing inside individual licenses (AND), a minimal report has to be made about each combination -* allow to view license properties from menu (prepend info to license) +* allow to view license properties from menu (prepend info to license), + together with previous item (in separate script file, with env vars) +* root switching support (like options) when asking to save license + approval/reject not implemented (for now avoids the error if trying + 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 -General: +Maybe: * additional targets (show-license, show-license-report, show-known-licenses, etc) - and ports framework configuration -* add common licenses (check a web page or try FOSSology) - -Maybe: -* separate groups into another variable (either internally and/or externally->better) * Consider licenses that need manual agreement/manual fetching provide framework help for manual distfile placing, etc maybe also add pkg-fetch-message or some variables to avoid manual IGNORE/printf? -* incorporate pattern matching in licenses/groups/distfiles/lic files - -> only if variables are solely used in commands - -Other: -* make 3 ports, each being an example of the 3 cases -* update wiki, save "script(1)" session and put there as demonstration, - update TODO list, put questions, put comments in tables ============================================================================== ==== //depot/projects/soc2008/alepulver-portslicense/ports/Mk/bsd.licenses.mk#5 (text+ko) ==== @@ -112,61 +112,10 @@ # - Check user and framework configuration. # - Define targets. -# XXX Start of editable section +# Include known licenses from database -# License definitions -# -# _LICENSE_LIST - List of defined licenses -# _LICENSE_LIST_GROUPS - List of defined license groups -# - -_LICENSE_LIST= GPLv2 -_LICENSE_LIST_GROUPS= FSF - -# Properties of license/group "xxx" (similar to port's variables, but single) -# _LICENSE_NAME_xxx - Full name/description of license/group -# _LICENSE_PERMS_xxx - Permissions -# _LICENSE_COMPAT_xxx - Compatibility -# _LICENSE_INCOMPAT_xxx - Incompatibility - -# List of licenses - -_LICENSE_NAME_GPLv2= GNU General Public License version 2 -_LICENSE_PERMS_GPLv2= dist-redist dist-sell pkg-redist pkg-sell auto-accept -_LICENSE_COMPAT_GPLv2= # -_LICENSE_INCOMPAT_GPLv2=# - -# List of groups - -_LICENSE_NAME_FSF= Free Software Foundation approved -_LICENSE_PERMS_FSF= # -_LICENSE_COMPAT_FSF= # -_LICENSE_INCOMPAT_FSF= # +.include "${PORTSDIR}/Mk/bsd.licenses.db.mk" -# Grouping -# -# - Method 1: -# _LICENSE_LIST_GROUP_xxx - List of licenses under the "xxx" group - -_LICENSE_LIST_GROUP_FSF= GPLv2 - -# - Method 2: -# _LICENSE_GROUPS_xxx - Groups the license/group belongs to - -# empty - -# XXX End of editable section - -# Method 1 expands to method 2 -.for group in ${_LICENSE_LIST_GROUPS} -. for lic in ${_LICENSE_LIST_GROUP_${group}} -_LICENSE_GROUPS_${lic}?= # -. if ${_LICENSE_GROUPS_${lic}:M${group}} == "" -_LICENSE_GROUPS_${lic}+= ${group} -. endif -. endfor -.endfor - # Lists of variables and valid components # # _LICENSE_LIST_PERMS - Valid permission components @@ -207,17 +156,17 @@ # _LICENSE_SINGLE - Defined for a single license # _LICENSE_MULTI - Set to "and"/"or"? (XXX Not implemented) -.for lic in ${_LICENSE} -. if defined(_LICENSE_DEFINED) -_LICENSE_MULTI= yes -. else -_LICENSE_DEFINED?= ${lic} -. endif -.endfor -.if !defined(_LICENSE_MULTI) -_LICENSE_SINGLE= yes -.endif -.undef _LICENSE_DEFINED +#.for lic in ${_LICENSE} +#. if defined(_LICENSE_DEFINED) +#_LICENSE_MULTI= yes +#. else +#_LICENSE_DEFINED?= ${lic} +#. endif +#.endfor +#.if !defined(_LICENSE_MULTI) +#_LICENSE_SINGLE= yes +#.endif +#.undef _LICENSE_DEFINED # Evaluate port license groups and permissions # @@ -225,11 +174,10 @@ # Case 1: "known" (license info taken from internal database) # Case 2: "variant" (LICENSE is known, but info taken from port) # Case 3: "unknown" (LICENSE is not known, and info taken from port) -# -# Make sure required variables are defined, and remove conflicting (positive +# # Make sure required variables are defined, and remove conflicting (positive # and negative) and duplicated components. -.if defined(_LICENSE_SINGLE) +#.if defined(_LICENSE_SINGLE) . for lic in ${_LICENSE} . if ${_LICENSE_LIST:M${lic}} != "" . for var in ${_LICENSE_LIST_PORT_VARS} @@ -314,9 +262,9 @@ _LICENSE_FILE= ${LICENSE_FILE} . endif . endfor -.else +#.else # XXX dual/multiple licenses -.endif +#.endif # Check if the user agrees with the license # @@ -358,7 +306,7 @@ _LICENSE_TYPE_PAIRS_variant= _LICENSES,config _LICENSE_TYPE_PAIRS_unknown= _LICENSES,config -.if defined(_LICENSE_SINGLE) +#.if defined(_LICENSE_SINGLE) # User and saved configuration . for lic in ${_LICENSE} . for pair in ${_LICENSE_TYPE_PAIRS_${_LICENSE_TYPE}} @@ -407,9 +355,9 @@ . endif . endfor -.else +#.else # XXX dual/multiple licenses -.endif +#.endif # Check variables are correctly defined and print status up to here @@ -418,7 +366,7 @@ @${ECHO_MSG} "===> License not correctly defined: ${_LICENSE_ERROR}" @exit 1 .endif -.if defined(_LICENSE_SINGLE) +#.if defined(_LICENSE_SINGLE) . if ${_LICENSE_STATUS} == "rejected" @${ECHO_MSG} "===> License ${_LICENSE} rejected by the user (by ${_LICENSE_STATUS_FROM})" @exit 1 @@ -428,12 +376,12 @@ @${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 +# XXX escape shell chars? @${ECHO_CMD} ${LICENSE_TEXT} > ${_LICENSE_FILE} . endif -.else +#.else # XXX dual/multiple licenses -.endif +#.endif .if defined(LICENSES_CONFIG) _LICENSES_CONFIG= yes @@ -441,6 +389,14 @@ _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 config when user rejects +_LICENSES_ACCEPTED_NO= ${_LICENSES_ACCEPTED:N${_LICENSE}} +_LICENSES_REJECTED_NO= ${_LICENSES_REJECTED} ${_LICENSE} + # Display, ask and save preference if requested ask-license: @@ -478,7 +434,8 @@ ${ECHO_MSG} "===> You don't have permissions to save the choice"; \ else \ ${MKDIR} ${_LICENSE_CFG:H}; \ - (${ECHO_CMD} _LICENSES_ACCEPTED=${_LICENSE}; \ + (${ECHO_CMD} _LICENSES_ACCEPTED=${_LICENSES_ACCEPTED_YES}; \ + ${ECHO_CMD} _LICENSES_REJECTED=${_LICENSES_REJECTED_YES}; \ if [ ${_LICENSE_TYPE} != "known" ]; then \ ${ECHO_CMD} _LICENSE_${_LICENSE}_CHK=`${SHA256} -q ${_LICENSE_FILE}`; \ fi) > ${_LICENSE_FILE}; \ @@ -489,7 +446,8 @@ ${ECHO_MSG} "===> You don't have permissions to save the choice"; \ else \ ${MKDIR} ${_LICENSE_CFG:H}; \ - (${ECHO_CMD} _LICENSES_REJECTED=${_LICENSE}; \ + (${ECHO_CMD} _LICENSES_ACCEPTED=${_LICENSES_ACCEPTED_NO}; \ + ${ECHO_CMD} _LICENSES_REJECTED=${_LICENSES_REJECTED_NO}; \ if [ ${_LICENSE_TYPE} != "known" ]; then \ ${ECHO_CMD} _LICENSE_${_LICENSE}_CHK=`${SHA256} -q ${_LICENSE_FILE}`; \ fi) > ${_LICENSE_FILE}; \ @@ -500,8 +458,10 @@ esac; \ done -# License compatibility check (XXX is it useful? empty vaules of COMPAT do not -# mean "nothing") +# License compatibility check + +# XXX is it useful? Maybe BUILD/LIB depends too? +# also empty vaules of COMPAT do not mean "incompatible with all" .if !empty(_LICENSE_COMPAT) || !empty(_LICENSE_INCOMPAT) . for port in ${RUN_DEPENDS} @@ -559,7 +519,7 @@ .else # !LICENSE check-license: - @${ECHO_MSG} "===> WARNING: port has no defined LICENSE, check disabled" + @${ECHO_MSG} "===> License check disabled, port has not defined LICENSE" ask-license: @${DO_NADA}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808182351.m7INp9VI064085>