Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Mar 2011 20:55:49 +0300
From:      Pan Tsu <inyaoo@gmail.com>
To:        "J. Hellenthal" <jhell@DataIX.net>
Cc:        Christian Weisgerber <naddy@mips.inka.de>, freebsd-ports@freebsd.org
Subject:   Re: /tmp/portslicense.*
Message-ID:  <86ei5xsouy.fsf@gmail.com>
In-Reply-To: <alpine.BSF.2.00.1103231248470.5147@qvfongpu.qngnvk.ybpny> (J. Hellenthal's message of "Wed, 23 Mar 2011 12:50:07 -0400")
References:  <imcvcd$2ve8$1@lorvorc.mips.inka.de> <alpine.BSF.2.00.1103231248470.5147@qvfongpu.qngnvk.ybpny>

next in thread | previous in thread | raw e-mail | index | archive | help
"J. Hellenthal" <jhell@DataIX.net> writes:

> On Wed, 23 Mar 2011 10:16, naddy@ wrote:
>> I notice that empty portslicense.* files keep accumulating in /tmp.
>>> From time to time I manually delete them, but shouldn't the ports
>> framework remove them?
>>
>
> I haven't seen this happen once throughout the ports that I use. Can
> you identify the port that its originating from if it is originating
> from ports at all ?

It's the framework itself leaves that garbage when using LICENSES_ASK.

%%
Index: Mk/bsd.licenses.mk
===================================================================
RCS file: /a/.cvsup/ports/Mk/bsd.licenses.mk,v
retrieving revision 1.7
diff -u -p -r1.7 bsd.licenses.mk
--- Mk/bsd.licenses.mk	17 Mar 2011 14:29:58 -0000	1.7
+++ Mk/bsd.licenses.mk	23 Mar 2011 17:53:22 -0000
@@ -493,7 +493,7 @@ _LICENSE_GROUPS:=	${_LICENSE_GROUPS:N${c
 # Prepare information for asking license to the user
 
 .if ${_LICENSE_STATUS} == "ask" && ${_LICENSE_COMB} != "single"
-_LICENSE_ASK_DATA!=	mktemp -t portslicense
+_LICENSE_ASK_DATA!=	mktemp -ut portslicense
 .endif
 
 # Calculate restrictions and set RESTRICTED_FILES when
@@ -596,8 +596,9 @@ ${_LICENSE_COOKIE}:
 .	if !defined(NO_LICENSES_DIALOGS)
 # Dialog interface
 .		if ${_LICENSE_COMB} == "single"
-	@while true; do \
-		tmpfile=$$(mktemp -t portlicenses); \
+	@trap '${RM} -f $$tmpfile' EXIT INT TERM; \
+	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}"; \
 		result=`${CAT} $${tmpfile}`; \
 		case $${result} in \
@@ -613,6 +614,7 @@ ${_LICENSE_COOKIE}:
 	@${ECHO_CMD} "${lic}:${_LICENSE_FILE_${lic}}" >> ${_LICENSE_ASK_DATA}
 .			endfor
 	@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); \
 	for lic in ${_LICENSE_TO_ASK}; do \
 		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}
 .			endfor
 	@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); \
 	for lic in ${_LICENSE_TO_ASK}; do \
 		menu_cmd="$${menu_cmd} VIEW_$${lic} \"View the license $${lic}\""; \
@@ -679,6 +682,7 @@ ${_LICENSE_COOKIE}:
 	@${ECHO_MSG}
 	@exit 1
 .	endif
+	@${RM} -f ${_LICENSE_ASK_DATA}
 .endif
 
 # Create report and catalog
%%



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