From: Bruno Haible Date: Tue, 19 Feb 2002 14:27:17 +0000 (+0000) Subject: Fix for "make distcheck". X-Git-Tag: v0.11.1~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e45ba9074fbe2c59b348178baa315bf65e091cfa;p=thirdparty%2Fgettext.git Fix for "make distcheck". --- diff --git a/po/ChangeLog b/po/ChangeLog index a67cb778f..71f5ba950 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,17 @@ +2002-02-19 Bruno Haible + + * 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 * de.po: Update from Karl Eichwalder . diff --git a/po/Makefile.in.in b/po/Makefile.in.in index e95553267..2d8baba41 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -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 index 000000000..2436c49e7 --- /dev/null +++ b/po/remove-potcdate.sin @@ -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 +}