- Disable license checking with DISABLE_LICENSES [1]

- Remove temp files from /tmp when build is interrupted [2]

PR:		ports/149837 [1], ports/155890 [2]
This commit is contained in:
Thomas Abthorpe 2011-03-31 03:37:14 +00:00
parent 0636075d2a
commit 87f78ba5a9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=272028
2 changed files with 11 additions and 5 deletions

View file

@ -123,7 +123,7 @@ Licenses_Include_MAINTAINER= portmgr@FreeBSD.org
.if defined(_POSTMKINCLUDED) && !defined(BEFOREPORTMK) .if defined(_POSTMKINCLUDED) && !defined(BEFOREPORTMK)
.if defined(LICENSE) && !defined(DISABLE_LICENSES) .if defined(LICENSE)
# Include known licenses from database # Include known licenses from database
@ -493,7 +493,7 @@ _LICENSE_GROUPS:= ${_LICENSE_GROUPS:N${comp}}
# Prepare information for asking license to the user # Prepare information for asking license to the user
.if ${_LICENSE_STATUS} == "ask" && ${_LICENSE_COMB} != "single" .if ${_LICENSE_STATUS} == "ask" && ${_LICENSE_COMB} != "single"
_LICENSE_ASK_DATA!= mktemp -t portslicense _LICENSE_ASK_DATA!= mktemp -ut portslicense
.endif .endif
# Calculate restrictions and set RESTRICTED_FILES when # Calculate restrictions and set RESTRICTED_FILES when
@ -596,8 +596,9 @@ ${_LICENSE_COOKIE}:
. if !defined(NO_LICENSES_DIALOGS) . if !defined(NO_LICENSES_DIALOGS)
# Dialog interface # Dialog interface
. if ${_LICENSE_COMB} == "single" . if ${_LICENSE_COMB} == "single"
@while true; do \ trap '${RM} -f $$tmpfile' EXIT INT TERM; \
tmpfile=$$(mktemp -t portlicenses); \ tmpfile=$$(mktemp -t portlicenses); \
while true; do \
${DIALOG} --menu "License for ${PKGNAME} (${_LICENSE})" 21 70 15 accept "Accept license" reject "Reject license" view "View license" 2>"$${tmpfile}"; \ ${DIALOG} --menu "License for ${PKGNAME} (${_LICENSE})" 21 70 15 accept "Accept license" reject "Reject license" view "View license" 2>"$${tmpfile}"; \
result=`${CAT} $${tmpfile}`; \ result=`${CAT} $${tmpfile}`; \
case $${result} in \ case $${result} in \
@ -613,6 +614,7 @@ ${_LICENSE_COOKIE}:
@${ECHO_CMD} "${lic}:${_LICENSE_FILE_${lic}}" >> ${_LICENSE_ASK_DATA} @${ECHO_CMD} "${lic}:${_LICENSE_FILE_${lic}}" >> ${_LICENSE_ASK_DATA}
. endfor . endfor
@menu_cmd="${DIALOG} --title \"This port requires you to accept at least one license\" --menu \"License for ${PKGNAME} (dual)\" 21 70 15"; \ @menu_cmd="${DIALOG} --title \"This port requires you to accept at least one license\" --menu \"License for ${PKGNAME} (dual)\" 21 70 15"; \
trap '${RM} -f $$tmpfile' EXIT INT TERM; \
tmpfile=$$(mktemp -t portlicenses); \ tmpfile=$$(mktemp -t portlicenses); \
for lic in ${_LICENSE_TO_ASK}; do \ for lic in ${_LICENSE_TO_ASK}; do \
menu_cmd="$${menu_cmd} VIEW_$${lic} \"View the license $${lic}\" USE_$${lic} \"Accept the license $${lic}\""; \ menu_cmd="$${menu_cmd} VIEW_$${lic} \"View the license $${lic}\" USE_$${lic} \"Accept the license $${lic}\""; \
@ -638,6 +640,7 @@ ${_LICENSE_COOKIE}:
@${ECHO_CMD} "${lic}:${_LICENSE_FILE_${lic}}" >> ${_LICENSE_ASK_DATA} @${ECHO_CMD} "${lic}:${_LICENSE_FILE_${lic}}" >> ${_LICENSE_ASK_DATA}
. endfor . endfor
@menu_cmd="${DIALOG} --title \"This port requires you to accept all mentioned licenses\" --menu \"License for ${PKGNAME} (multi)\" 21 70 15"; \ @menu_cmd="${DIALOG} --title \"This port requires you to accept all mentioned licenses\" --menu \"License for ${PKGNAME} (multi)\" 21 70 15"; \
trap '${RM} -f $$tmpfile' EXIT INT TERM; \
tmpfile=$$(mktemp -t portlicenses); \ tmpfile=$$(mktemp -t portlicenses); \
for lic in ${_LICENSE_TO_ASK}; do \ for lic in ${_LICENSE_TO_ASK}; do \
menu_cmd="$${menu_cmd} VIEW_$${lic} \"View the license $${lic}\""; \ menu_cmd="$${menu_cmd} VIEW_$${lic} \"View the license $${lic}\""; \
@ -679,6 +682,7 @@ ${_LICENSE_COOKIE}:
@${ECHO_MSG} @${ECHO_MSG}
@exit 1 @exit 1
. endif . endif
@${RM} -f ${_LICENSE_ASK_DATA}
.endif .endif
# Create report and catalog # Create report and catalog
@ -757,7 +761,7 @@ install-license:
.endif .endif
.elif !defined(DISABLE_LICENSES) # !LICENSE .else # !LICENSE
check-license: check-license:
@${ECHO_MSG} "===> License check disabled, port has not defined LICENSE" @${ECHO_MSG} "===> License check disabled, port has not defined LICENSE"

View file

@ -2512,7 +2512,9 @@ ALL_TARGET?= all
INSTALL_TARGET?= install INSTALL_TARGET?= install
# Integrate with the license auditing framework # Integrate with the license auditing framework
.if !defined (DISABLE_LICENSES)
.include "${PORTSDIR}/Mk/bsd.licenses.mk" .include "${PORTSDIR}/Mk/bsd.licenses.mk"
.endif
# Popular master sites # Popular master sites
.include "${PORTSDIR}/Mk/bsd.sites.mk" .include "${PORTSDIR}/Mk/bsd.sites.mk"