Subject: pkg/22348: archivers/gsharutils can't handle catalog files of suffix of multiple types
To: None <gnats-bugs@gnats.netbsd.org>
From: None <hira@po6.nsk.ne.jp>
List: netbsd-bugs
Date: 08/03/2003 22:53:26
>Number:         22348
>Category:       pkg
>Synopsis:       archivers/gsharutils can't handle catalog files of suffix of multiple types
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 03 13:54:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Kouichirou Hiratsuka
>Release:        NetBSD 1.6W
>Organization:
>Environment:
System: NetBSD firefly.localdomain 1.6W NetBSD 1.6W (FIREFLY) #133: Sun Aug 3 16:13:49 JST 2003 root@firefly.localdomain:/usr/src/sys/arch/i386/compile/FIREFLY i386
Architecture: i386
Machine: i386
>Description:
	A configure appends catalog files to CATALOGS and it sets CATOBJEXT to
	suffix. If suffix is not equal to ".gmo", ".gmo" files are appended to
	CATALOGS forcibly.

	And then, to decide a install directory of catalog files, po/Makefile
	substitute suffix of CATALOGS by CATOBJEXT. This substitute is used to
	remove suffix. However, it is fail, because suffix is multiple types
	and CATOBJEXT is single type. As a result, it makes directory that end
	with dot under ${PREFIX}/share/locale. (e.g. de. fr.)

	In addition, gnulocaledir and localedir becomes same directory. In this
	case, ".mo" files are overwritten with ".gmo" files. Therefore ".gmo"
	files may not need to be installed.

>How-To-Repeat:
	cd ${PKGSRCDIR}/archivers/gsharutils
	make install
	ls ${PREFIX}/share/locale/

>Fix:
	* don't use suffix (CATOBJEXT) in substitute
	* don't install ".gmo" files (when gnulocaledir and localedir are equal
	  and CATOBJEXT is not equal to ".gmo")

--- po/Makefile.in.in.orig	2003-08-03 20:36:48.000000000 +0900
+++ po/Makefile.in.in	2003-08-03 20:37:01.000000000 +0900
@@ -120,11 +120,15 @@
 	catalogs='$(CATALOGS)'; \
 	for cat in $$catalogs; do \
 	  if test "`echo $$cat | sed 's/.*\(\..*\)/\1/'`" = ".gmo"; then \
+	    if test $(gnulocaledir) = $(localedir) -a \
+		    $(CATOBJEXT) != ".gmo"; then \
+	      continue; \
+	    fi; \
 	    destdir=$(gnulocaledir); \
 	  else \
 	    destdir=$(localedir); \
 	  fi; \
-	  lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
+	  lang=`echo $$cat | sed 's/\(.*\)\.[^\.]*/\1/'`; \
 	  dir=$$destdir/$$lang/LC_MESSAGES; \
 	  $(top_srcdir)/mkinstalldirs $$dir; \
 	  if test -r $$cat; then \
@@ -144,7 +148,7 @@
 uninstall:
 	catalogs='$(CATALOGS)'; \
 	for cat in $$catalogs; do \
-	  lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
+	  lang=`echo $$cat | sed 's/\(.*\)\.[^\.]*/\1/'`; \
 	  rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
 	  rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
 	done
@@ -180,7 +184,7 @@
 	cd $(srcdir); \
 	catalogs='$(CATALOGS)'; \
 	for cat in $$catalogs; do \
-	  lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
+	  lang=`echo $$cat | sed 's/\(.*\)\.[^\.]*/\1/'`; \
 	  mv $$lang.po $$lang.old.po; \
 	  if $(TUPDATE) $(PACKAGE).pot $$lang.old.po > $$lang.po; then \
 	    rm -f $$lang.old.po; \
>Release-Note:
>Audit-Trail:
>Unformatted: