]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix for "make distcheck".
authorBruno Haible <bruno@clisp.org>
Tue, 19 Feb 2002 14:27:17 +0000 (14:27 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 23:24:26 +0000 (01:24 +0200)
po/ChangeLog
po/Makefile.in.in
po/remove-potcdate.sin [new file with mode: 0644]

index a67cb778fd637753e05f7c39efc696ec8ab095a3..71f5ba9506776643e03a91a320423d1e3a86413b 100644 (file)
@@ -1,3 +1,17 @@
+2002-02-19  Bruno Haible  <bruno@clisp.org>
+
+       * remove-potcdate.sin: New file.
+       * Makefile.in.in (DISTFILES.common): Add remove-potcdate.sin.
+       (.SUFFIXES): Add .sed and .sin.
+       (.sin.sed): New rule.
+       ($(DOMAIN).pot-update): Depend on remove-potcdate.sed. If the old
+       POT file exists and the new POT file differs from it only in the
+       first POT-Creation-Date line, keep the old POT file. So the PO files
+       don't need to be remade, and automake's "distcheck" target succeeds.
+       (mostlyclean): Remove remove-potcdate.sed and additional temporary
+       files.
+       Reported by Jim Meyering.
+
 2002-02-13  Bruno Haible  <bruno@clisp.org>
 
        * de.po: Update from Karl Eichwalder <ke@suse.de>.
index e955532671d24bf42c3032e833675a18e25bf891..2d8baba41b5b6336243a8413b42761437fb5f71a 100644 (file)
@@ -42,7 +42,7 @@ POFILES = @POFILES@
 GMOFILES = @GMOFILES@
 UPDATEPOFILES = @UPDATEPOFILES@
 DUMMYPOFILES = @DUMMYPOFILES@
-DISTFILES.common = Makefile.in.in Makevars \
+DISTFILES.common = Makefile.in.in Makevars remove-potcdate.sin \
 $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
 DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot \
 $(POFILES) $(GMOFILES) \
@@ -55,7 +55,7 @@ CATALOGS = @CATALOGS@
 # Makevars gets inserted here. (Don't remove this line!)
 
 .SUFFIXES:
-.SUFFIXES: .po .gmo .mo .nop .po-update
+.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update
 
 .po.mo:
        $(MSGFMT) -c -o $@ $<
@@ -66,6 +66,10 @@ CATALOGS = @CATALOGS@
        echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
        cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po
 
+.sin.sed:
+       sed -e '/^#/d' $< > t-$@
+       mv t-$@ $@
+
 
 all: all-@USE_NLS@
 
@@ -76,14 +80,25 @@ all-no:
 # otherwise packages like GCC can not be built if only parts of the source
 # have been downloaded.
 
-$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in
+$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
        $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
          --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
          --files-from=$(srcdir)/POTFILES.in \
-         --copyright-holder='$(COPYRIGHT_HOLDER)' \
-       && test ! -f $(DOMAIN).po \
-          || ( rm -f $(srcdir)/$(DOMAIN).pot \
-               && mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot )
+         --copyright-holder='$(COPYRIGHT_HOLDER)'
+       test ! -f $(DOMAIN).po || { \
+         if test -f $(srcdir)/$(DOMAIN).pot; then \
+           sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
+           sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
+           if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
+             rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
+           else \
+             rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
+             mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+           fi; \
+         else \
+           mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+         fi; \
+       }
 
 $(srcdir)/$(DOMAIN).pot:
        $(MAKE) $(DOMAIN).pot-update
@@ -222,7 +237,8 @@ check: all
 dvi info tags TAGS ID:
 
 mostlyclean:
-       rm -f core core.* $(DOMAIN).po *.new.po
+       rm -f remove-potcdate.sed
+       rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
        rm -fr *.o
 
 clean: mostlyclean
diff --git a/po/remove-potcdate.sin b/po/remove-potcdate.sin
new file mode 100644 (file)
index 0000000..2436c49
--- /dev/null
@@ -0,0 +1,19 @@
+# Sed script that remove the POT-Creation-Date line in the header entry
+# from a POT file.
+#
+# The distinction between the first and the following occurrences of the
+# pattern is achieved by looking at the hold space.
+/^"POT-Creation-Date: .*"$/{
+x
+# Test if the hold space is empty.
+s/P/P/
+ta
+# Yes it was empty. First occurrence. Remove the line.
+g
+d
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}