bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gettext] Removing auto-update rules from po/Makefile.in.in


From: Daiki Ueno
Subject: [bug-gettext] Removing auto-update rules from po/Makefile.in.in
Date: Fri, 28 Mar 2014 18:24:30 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Hi Bruno, folks,

I'm revisiting this:
https://lists.gnu.org/archive/html/bug-gettext/2013-07/msg00004.html

More specifically, this discussion:
https://mail.gnome.org/archives/desktop-devel-list/2011-July/msg00088.html

Given the recent popularity of GIT, it doesn't make much sense to update
PO files based on the timestamp of a POT file, IMHO.

I see some Gnulib based projects already started keeping the 'po'
directory empty and downloading PO files from external repository using
the 'bootstrap' script, but there are many other projects keeping PO
files in the same repository as code.

So, basically, the idea is to remove the related auto-update rules from
po/Makefile.in.in, and let developers and translators update PO files
manually with "make update-po".

However, I worry if this might cause any serious problem (e.g. breaking
builds or losing translations).  What do you think?

I'm attaching a patch for this.

Regards,
--
Daiki Ueno
>From bff9255ad9982f3646ec14af22d7c936d93b8fda Mon Sep 17 00:00:00 2001
From: Daiki Ueno <address@hidden>
Date: Fri, 28 Mar 2014 18:11:03 +0900
Subject: [PATCH] autopoint: Remove auto-update rules from Makefile.in.in

* po/Makefile.in.in (update): Rename from stamp-po; don't create POT
and timestamp files; all callers changed.
($(POFILES)): Don't depend on $(DOMAIN).pot; don't update existing
PO files.
(dist, distdir): Call $(MAKE) update-gmo, instead of $(MAKE)
update-po.
---
 gettext-runtime/po/Makefile.in.in | 58 ++++++++-------------------------------
 1 file changed, 11 insertions(+), 47 deletions(-)

diff --git a/gettext-runtime/po/Makefile.in.in 
b/gettext-runtime/po/Makefile.in.in
index fabdc76..a0305ab 100644
--- a/gettext-runtime/po/Makefile.in.in
+++ b/gettext-runtime/po/Makefile.in.in
@@ -99,7 +99,7 @@ CATALOGS = @CATALOGS@
 
 all: address@hidden@
 
-all-yes: stamp-po
+all-yes: update
 all-no:
 
 # Ensure that the gettext macros and this Makefile.in.in are in sync.
@@ -109,29 +109,9 @@ CHECK_MACRO_VERSION = \
               exit 1; \
             }
 
-# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
-# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
-# we don't want to bother translators with empty POT files). We assume that
-# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
-# In this case, stamp-po is a nop (i.e. a phony target).
-
-# stamp-po is a timestamp denoting the last time at which the CATALOGS have
-# been loosely updated. Its purpose is that when a developer or translator
-# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
-# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
-# invocations of "make" will do nothing. This timestamp would not be necessary
-# if updating the $(CATALOGS) would always touch them; however, the rule for
-# $(POFILES) has been designed to not touch files that don't need to be
-# changed.
-stamp-po: $(srcdir)/$(DOMAIN).pot
+update:
        @$(CHECK_MACRO_VERSION)
-       test ! -f $(srcdir)/$(DOMAIN).pot || \
-         test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
-       @test ! -f $(srcdir)/$(DOMAIN).pot || { \
-         echo "touch stamp-po" && \
-         echo timestamp > stamp-poT && \
-         mv stamp-poT stamp-po; \
-       }
+       test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
 
 # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
 # otherwise packages like GCC can not be built if only parts of the source
@@ -193,28 +173,13 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in 
remove-potcdate.sed
 
 # This rule has no dependencies: we don't need to update $(DOMAIN).pot at
 # every "make" invocation, only create it when it is missing.
-# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
+# Only "make $(DOMAIN).pot-update" will force an update.
 $(srcdir)/$(DOMAIN).pot:
        $(MAKE) $(DOMAIN).pot-update
 
-# This target rebuilds a PO file if $(DOMAIN).pot has changed.
-# Note that a PO file is not touched if it doesn't need to be changed.
-$(POFILES): $(srcdir)/$(DOMAIN).pot
+$(POFILES):
        @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
-       if test -f "$(srcdir)/$${lang}.po"; then \
-         test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-         echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} 
$${lang}.po $(DOMAIN).pot"; \
-         cd $(srcdir) \
-           && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 
's,^[^0-9]*,,'` in \
-                  '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
-                    $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po 
$(DOMAIN).pot;; \
-                  *) \
-                    $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} 
$${lang}.po $(DOMAIN).pot;; \
-                esac; \
-              }; \
-       else \
-         $(MAKE) $${lang}.po-create; \
-       fi
+       $(MAKE) $${lang}.po-create
 
 
 install: install-exec install-data
@@ -346,7 +311,6 @@ info dvi ps pdf html tags TAGS ctags CTAGS ID:
 
 mostlyclean:
        rm -f remove-potcdate.sed
-       rm -f stamp-poT
        rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
        rm -fr *.o
 
@@ -358,20 +322,20 @@ distclean: clean
 maintainer-clean: distclean
        @echo "This command is intended for maintainers to use;"
        @echo "it deletes files that may require special tools to rebuild."
-       rm -f stamp-po $(GMOFILES)
+       rm -f $(GMOFILES)
 
 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
 dist distdir:
-       $(MAKE) update-po
+       $(MAKE) update-gmo
        @$(MAKE) dist2
-# This is a separate target because 'update-po' must be executed before.
-dist2: stamp-po $(DISTFILES)
+# This is a separate target because 'update-gmo' must be executed before.
+dist2: $(DISTFILES)
        dists="$(DISTFILES)"; \
        if test "$(PACKAGE)" = "gettext-tools"; then \
          dists="$$dists Makevars.template"; \
        fi; \
        if test -f $(srcdir)/$(DOMAIN).pot; then \
-         dists="$$dists $(DOMAIN).pot stamp-po"; \
+         dists="$$dists $(DOMAIN).pot"; \
        fi; \
        if test -f $(srcdir)/ChangeLog; then \
          dists="$$dists ChangeLog"; \
-- 
1.8.4.2


reply via email to

[Prev in Thread] Current Thread [Next in Thread]