Subject: Re: gettext library in gnu/usr.bin/grep
To: None <tech-userlevel@netbsd.org>
From: Jun-ichiro itojun Hagino <itojun@iijlab.net>
List: tech-userlevel
Date: 10/19/2000 13:18:24
>	we are using local gettext library in gnu/usr.bin/grep.  i believe
>	we should not do this, and migrate to gettext supplied in libc
>	or whatever (in the future, yes), and we should stop shipping
>	/usr/share/locale/*/LC_MESSAGES/grep.mo.  comments?

	this patch should do it (may need change in etc/mtree).

itojun


Index: gnu/usr.bin/grep/Makefile
===================================================================
RCS file: /cvsroot/gnusrc/gnu/usr.bin/grep/Makefile,v
retrieving revision 1.16
diff -u -r1.16 Makefile
--- gnu/usr.bin/grep/Makefile	2000/02/28 10:00:57	1.16
+++ gnu/usr.bin/grep/Makefile	2000/10/19 04:17:17
@@ -3,30 +3,30 @@
 .include <bsd.own.mk>
 
 PROG=		grep
-SRCS=		bindtextdom.c dcgettext.c dgettext.c gettext.c finddomain.c \
-		loadmsgcat.c localealias.c textdomain.c l10nflist.c \
-		explodename.c intl-compat.c
 SRCS+=		grep.c dfa.c kwset.c obstack.c savedir.c getopt.c getopt1.c \
 		search.c stpcpy.c regex.c grepmat.c
 MAN=		grep.1
 
 DIST=		${.CURDIR}/../../dist
 
-CPPFLAGS+=	-I${DIST}/grep/src -I${DIST}/grep/intl -I${.CURDIR} \
-		-DHAVE_CONFIG_H \
-		-DGNULOCALEDIR=\"/usr/share/locale\" \
-		-DLOCALE_ALIAS_PATH=\"/usr/share/locale:.\" \
-		-DLOCALEDIR=\"/usr/share/locale\"
+CPPFLAGS+=	-I${DIST}/grep/src -I${.CURDIR} -DHAVE_CONFIG_H
 CLEANFILES+=    ${PROG}.1 ${PROG}.info ${PROG}.cat1
 
-.if ${MKNLS} != "no"
-.for F in de.gmo el.gmo es.gmo fr.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo \
-	ru.gmo sl.gmo sv.gmo
-FILES+=		${F}
-FILESDIR_${F}=	/usr/share/locale/${F:.gmo=}/LC_MESSAGES
-FILESNAME_${F}=	grep.mo
-.endfor
-.endif
+# local NLS code - shouldn't be used
+#SRCS+=		bindtextdom.c dcgettext.c dgettext.c gettext.c finddomain.c \
+#		loadmsgcat.c localealias.c textdomain.c l10nflist.c \
+#		explodename.c intl-compat.c
+#CPPFLAGS+=	-I${DIST}/grep/intl -DGNULOCALEDIR=\"/usr/share/locale\" \
+#		-DLOCALE_ALIAS_PATH=\"/usr/share/locale:.\" \
+#		-DLOCALEDIR=\"/usr/share/locale\" -DENABLE_NLS
+#.if ${MKNLS} != "no"
+#.for F in de.gmo el.gmo es.gmo fr.gmo ko.gmo nl.gmo no.gmo pl.gmo pt_BR.gmo \
+#	ru.gmo sl.gmo sv.gmo
+#FILES+=		${F}
+#FILESDIR_${F}=	/usr/share/locale/${F:.gmo=}/LC_MESSAGES
+#FILESNAME_${F}=	grep.mo
+#.endfor
+#.endif
 
 TEXINFO=	grep.texi
 INFOFLAGS=	-I${.CURDIR}/../../dist/grep/doc
Index: gnu/usr.bin/grep/config.h
===================================================================
RCS file: /cvsroot/gnusrc/gnu/usr.bin/grep/config.h,v
retrieving revision 1.2
diff -u -r1.2 config.h
--- gnu/usr.bin/grep/config.h	2000/02/27 01:31:02	1.2
+++ gnu/usr.bin/grep/config.h	2000/10/19 04:17:17
@@ -64,7 +64,7 @@
 
 /* #undef HAVE_STPCPY */
 
-#define ENABLE_NLS 1
+/* #undef ENABLE_NLS */
 
 /* #undef HAVE_CATGETS */
 
Index: distrib/sets/lists/base/mi
===================================================================
RCS file: /cvsroot/basesrc/distrib/sets/lists/base/mi,v
retrieving revision 1.182
diff -u -r1.182 mi
--- distrib/sets/lists/base/mi	2000/09/28 22:25:28	1.182
+++ distrib/sets/lists/base/mi	2000/10/19 04:17:18
@@ -893,43 +893,17 @@
 ./usr/share/lkm/vfs/module
 ./usr/share/locale
 ./usr/share/locale/de
-./usr/share/locale/de/LC_MESSAGES
-./usr/share/locale/de/LC_MESSAGES/grep.mo
-./usr/share/locale/de/LC_MESSAGES/texinfo.mo
 ./usr/share/locale/el
-./usr/share/locale/el/LC_MESSAGES
-./usr/share/locale/el/LC_MESSAGES/grep.mo
 ./usr/share/locale/es
-./usr/share/locale/es/LC_MESSAGES
-./usr/share/locale/es/LC_MESSAGES/grep.mo
 ./usr/share/locale/fr
-./usr/share/locale/fr/LC_MESSAGES
-./usr/share/locale/fr/LC_MESSAGES/grep.mo
-./usr/share/locale/fr/LC_MESSAGES/texinfo.mo
 ./usr/share/locale/ko
-./usr/share/locale/ko/LC_MESSAGES
-./usr/share/locale/ko/LC_MESSAGES/grep.mo
 ./usr/share/locale/nl
-./usr/share/locale/nl/LC_MESSAGES
-./usr/share/locale/nl/LC_MESSAGES/grep.mo
 ./usr/share/locale/no
-./usr/share/locale/no/LC_MESSAGES
-./usr/share/locale/no/LC_MESSAGES/grep.mo
 ./usr/share/locale/pl
-./usr/share/locale/pl/LC_MESSAGES
-./usr/share/locale/pl/LC_MESSAGES/grep.mo
 ./usr/share/locale/pt_BR
-./usr/share/locale/pt_BR/LC_MESSAGES
-./usr/share/locale/pt_BR/LC_MESSAGES/grep.mo
 ./usr/share/locale/ru
-./usr/share/locale/ru/LC_MESSAGES
-./usr/share/locale/ru/LC_MESSAGES/grep.mo
 ./usr/share/locale/sl
-./usr/share/locale/sl/LC_MESSAGES
-./usr/share/locale/sl/LC_MESSAGES/grep.mo
 ./usr/share/locale/sv
-./usr/share/locale/sv/LC_MESSAGES
-./usr/share/locale/sv/LC_MESSAGES/grep.mo
 ./usr/share/man
 ./usr/share/man/COPYRIGHT
 ./usr/share/man/cat1
Index: distrib/sets/lists/base/obsolete.mi
===================================================================
RCS file: /cvsroot/basesrc/distrib/sets/lists/base/obsolete.mi,v
retrieving revision 1.12
diff -u -r1.12 obsolete.mi
--- distrib/sets/lists/base/obsolete.mi	2000/08/06 22:35:40	1.12
+++ distrib/sets/lists/base/obsolete.mi	2000/10/19 04:17:18
@@ -37,6 +37,32 @@
 /usr/share/doc/smm/01.setup/tahoe
 /usr/share/doc/smm/01.setup/vax
 /usr/share/games/ching
+/usr/share/locale/de/LC_MESSAGES
+/usr/share/locale/de/LC_MESSAGES/grep.mo
+/usr/share/locale/de/LC_MESSAGES/texinfo.mo
+/usr/share/locale/el/LC_MESSAGES
+/usr/share/locale/el/LC_MESSAGES/grep.mo
+/usr/share/locale/es/LC_MESSAGES
+/usr/share/locale/es/LC_MESSAGES/grep.mo
+/usr/share/locale/fr/LC_MESSAGES
+/usr/share/locale/fr/LC_MESSAGES/grep.mo
+/usr/share/locale/fr/LC_MESSAGES/texinfo.mo
+/usr/share/locale/ko/LC_MESSAGES
+/usr/share/locale/ko/LC_MESSAGES/grep.mo
+/usr/share/locale/nl/LC_MESSAGES
+/usr/share/locale/nl/LC_MESSAGES/grep.mo
+/usr/share/locale/no/LC_MESSAGES
+/usr/share/locale/no/LC_MESSAGES/grep.mo
+/usr/share/locale/pl/LC_MESSAGES
+/usr/share/locale/pl/LC_MESSAGES/grep.mo
+/usr/share/locale/pt_BR/LC_MESSAGES
+/usr/share/locale/pt_BR/LC_MESSAGES/grep.mo
+/usr/share/locale/ru/LC_MESSAGES
+/usr/share/locale/ru/LC_MESSAGES/grep.mo
+/usr/share/locale/sl/LC_MESSAGES
+/usr/share/locale/sl/LC_MESSAGES/grep.mo
+/usr/share/locale/sv/LC_MESSAGES
+/usr/share/locale/sv/LC_MESSAGES/grep.mo
 /usr/share/man/cat4/tahoe
 /usr/share/man/cat8/tahoe
 /usr/share/man/man4/tahoe