From nobody@FreeBSD.org  Mon Dec 18 00:31:00 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 6563C16A407
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Dec 2006 00:31:00 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 1DB6743CB7
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Dec 2006 00:31:00 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id kBI0UxPp004516
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Dec 2006 00:30:59 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id kBI0UxaL004515;
	Mon, 18 Dec 2006 00:30:59 GMT
	(envelope-from nobody)
Message-Id: <200612180030.kBI0UxaL004515@www.freebsd.org>
Date: Mon, 18 Dec 2006 00:30:59 GMT
From: Micheal Johnson<ahze@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] Mk/bsd.port.mk -- Add support to remove locale dirs not found in mtree via USE_GETTEXT=locale-name
X-Send-Pr-Version: www-3.0

>Number:         106848
>Category:       ports
>Synopsis:       [PATCH] Mk/bsd.port.mk -- Add support to remove locale dirs not found in mtree via USE_GETTEXT=locale-name
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 18 00:40:09 GMT 2006
>Closed-Date:    Sat Dec 19 16:28:40 UTC 2009
>Last-Modified:  Sat Dec 19 16:28:40 UTC 2009
>Originator:     Micheal Johnson
>Release:        
>Organization:
>Environment:
>Description:
This patch adds support for removing locale dirs not found in mtree via 
USE_GETTEXT=locale-name and adding @dirrmtry share/local/local-name to plist.

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.544
diff -u -r1.544 bsd.port.mk
--- bsd.port.mk	30 Sep 2006 19:25:45 -0000	1.544
+++ bsd.port.mk	18 Dec 2006 00:10:10 -0000
@@ -1780,11 +1780,7 @@
 .endif
 
 .if defined(USE_GETTEXT)
-.	if ${USE_GETTEXT:L} == "yes"
 LIB_DEPENDS+=	intl:${PORTSDIR}/devel/gettext
-.	else
-LIB_DEPENDS+=	intl.${USE_GETTEXT}:${PORTSDIR}/devel/gettext
-.	endif
 .endif
 
 .if defined(USE_LINUX_PREFIX) && defined(INSTALLS_SHLIB)
@@ -5435,6 +5431,19 @@
 .for dir in ${PLIST_DIRS}
 	@${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} | ${SED} -e 's,^,@dirrm ,' >> ${TMPPLIST}
 .endfor
+.if defined(USE_GETTEXT) && ${USE_GETTEXT:L} != "yes"
+	@${MKDIR} ${WRKDIR}/emptydir
+	@${MTREE_CMD} -f ${MTREE_FILE} -L -p ${WRKDIR}/emptydir | ${GREP} "share/locale/.*/LC_MESSAGES" \
+		| ${SED} -e 's|./||; s| missing||' > ${WRKDIR}/.locale.mtree
+. for po in ${USE_GETTEXT}
+	@for i in `${GREP} "^share/locale/.*/LC_MESSAGES/${po}.mo" ${TMPPLIST} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} | ${CUT} -d / -f 1-4 | ${SORT} -r`; do \
+		if [ "$${i}//" != "`${GREP} -o "$${i}//" ${WRKDIR}/.locale.mtree`" ]; then \
+			${ECHO_CMD} "@unexec rmdir %D/$${i} 2>/dev/null || true" >> ${TMPPLIST} ; \
+			${ECHO_CMD} $${i} | ${CUT} -d / -f 1-3 | ${SED} -e 's|^|@unexec rmdir %D/|; s~$$~ 2>/dev/null || true~' >> ${TMPPLIST} ; \
+		fi \
+	done
+. endfor
+.endif
 # To be removed once INSTALLS_SHLIB has been eradicated.
 .if defined(INSTALLS_SHLIB) && !defined(INSTALL_AS_USER)
 	@${ECHO_CMD} "@exec ${LDCONFIG_PLIST_EXEC_CMD}" >> ${TMPPLIST}

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Dec 18 01:32:17 UTC 2006 
Responsible-Changed-Why:  
bsd.port.mk is port manager territory 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106848 
State-Changed-From-To: open->suspended 
State-Changed-By: linimon 
State-Changed-When: Fri May 25 03:39:11 UTC 2007 
State-Changed-Why:  
The idea may be fine but the implementation seems like an overloading of 
an existing variable name.  For backwards compatibility, wouldn't it be 
better to do something like 

.if USE_GETTEXT 
LOCALE_DIRS=(list) 
.endif 

This needs further thought. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106848 
State-Changed-From-To: suspended->feedback 
State-Changed-By: flz 
State-Changed-When: Fri Sep 11 15:13:17 UTC 2009 
State-Changed-Why:  
Waiting for feedback. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106848 

From: Florent Thoumie <flz@xbsd.org>
To: bug-followup@freebsd.org, ahze@freebsd.org
Cc:  
Subject: Re: ports/106848
Date: Fri, 11 Sep 2009 16:12:45 +0100

 --001485e984d5bd079b04734ec0eb
 Content-Type: text/plain; charset=ISO-8859-1
 
 Now that BSD.local.dist has been moved to ports, it sounds much better to
 just add missing locale directory to it rather than adding a new variable.
 Thoughts?
 
 -- 
 Florent Thoumie
 flz@FreeBSD.org
 FreeBSD Committer
 
 --001485e984d5bd079b04734ec0eb
 Content-Type: text/html; charset=ISO-8859-1
 
 Now that BSD.local.dist has been moved to ports, it sounds much better to just add missing locale directory to it rather than adding a new variable.<div><br></div><div>Thoughts?<br clear="all"><br>-- <br>Florent Thoumie<br>
 
 flz@FreeBSD.org<br>FreeBSD Committer<br>
 </div>
 
 --001485e984d5bd079b04734ec0eb--
State-Changed-From-To: feedback->closed 
State-Changed-By: pav 
State-Changed-When: Sat Dec 19 16:27:07 UTC 2009 
State-Changed-Why:  
Agreed with flz, thus rejecting this patch.  I think adding three lines to 
pkg-plist is not that big a burden. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106848 
>Unformatted:
