ports/71531: change-request: remove GNU gettext reference files

Yen-Ming Lee leeym at FreeBSD.org
Thu Sep 9 15:50:27 UTC 2004


>Number:         71531
>Category:       ports
>Synopsis:       change-request: remove GNU gettext reference files
>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:   Thu Sep 09 15:50:14 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Yen-Ming Lee
>Release:        FreeBSD 5.3-BETA3 i386
>Organization:
FreeBSD Taiwan
>Environment:
System: FreeBSD utopia.leeym.com 5.3-BETA3 FreeBSD 5.3-BETA3 #1: Sun Sep 5 01:06:46 CST 2004 root at utopia.leeym.com:/usr/obj/usr/src/sys/UTOPIA i386


	
>Description:

GNU gettext reference files (*.alias):
lib/charset.alias
share/locale/locale.alias

If a port depends on gettext library, it may requires some reference files.
During installatin, the port will register itself in these reference files,
however it won't be unregistered when deinstalling.

add add-plist-intl target in bsd.port.mk to deal with these files:
1. unregister the port from the reference files.
2. if the port is the last one using it, then remove the reference files.

>How-To-Repeat:

http://pointyhat.freebsd.org/errorlogs/i386-5-full-logs/extras.html
(anubis, beaver, coreutils, doc++, elinks, gnuls, minicom.....)

>Fix:

	

--- add-plist-intl.diff begins here ---
Index: bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.497
diff -u -r1.497 bsd.port.mk
--- bsd.port.mk	3 Aug 2004 19:03:58 -0000	1.497
+++ bsd.port.mk	9 Sep 2004 15:16:27 -0000
@@ -1383,6 +1383,7 @@
 .	else
 LIB_DEPENDS+=	intl.${USE_GETTEXT}:${PORTSDIR}/devel/gettext
 .	endif
+USE_REINPLACE=	yes
 .endif
 
 .if defined(USE_LINUX)
@@ -3555,6 +3556,7 @@
 _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \
 				pre-su-install-script do-install post-install \
 				post-install-script add-plist-info add-plist-docs \
+				add-plist-intl \
 				compress-man run-ldconfig fake-pkg security-check
 _PACKAGE_DEP=	install
 _PACKAGE_SEQ=	package-message pre-package pre-package-script \
@@ -4658,6 +4660,15 @@
 .endfor
 .if !defined(NO_MTREE)
 	@${ECHO_CMD} "@unexec if [ -f %D/${INFO_PATH}/dir ]; then if sed -e '1,/Menu:/d' %D/${INFO_PATH}/dir | grep -q '^[*] '; then true; else rm %D/${INFO_PATH}/dir; fi; fi" >> ${TMPPLIST}
+.endif
+
+add-plist-intl:
+# Process GNU gettext (libintl) reference files at package deinstall time
+.if defined(USE_GETTEXT)
+.for f in lib/charset.alias share/locale/locale.alias
+	@${ECHO_CMD} "@unexec ${REINPLACE_CMD} 's, ${PORTNAME} , ,g' %D/${f} && rm %D/${f}.bak" >> ${TMPPLIST}
+	@${ECHO_CMD} "@unexec if grep -q '^# Packages using this file: $$' %D/${f}; then rm %D/${f}; else true; fi" >> ${TMPPLIST}
+.endfor
 .endif
 
 # Compress (or uncompress) and symlink manpages.
--- add-plist-intl.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list