+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>.
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) \
# 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 $@ $<
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@
# 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
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
--- /dev/null
+# 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
+}