Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Dec 2006 00:30:59 GMT
From:      Micheal Johnson<ahze@FreeBSD.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/106848: [PATCH] Mk/bsd.port.mk -- Add support to remove locale dirs not found in mtree via USE_GETTEXT=locale-name
Message-ID:  <200612180030.kBI0UxaL004515@www.freebsd.org>
Resent-Message-ID: <200612180040.kBI0eAEN027410@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 18 00:40:09 GMT 2006
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



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