bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: fix for `make distcheck' failure in gettextized packages


From: Bruno Haible
Subject: Re: fix for `make distcheck' failure in gettextized packages
Date: Tue, 19 Feb 2002 15:28:26 +0100 (CET)

Jim Meyering writes:

> I've just upgraded to gettext-0.11 and found only one problem:
> that check failed when `make dist' tried to remove and recreate
> the po/textutils.pot file in a read-only hierarchy.
> 
> Here's a non-portable patch -- it relies on GNU diff's -I option.

Please use this patch. Thanks for the report.

Bruno



2002-02-19  Bruno Haible  <address@hidden>

        * 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.

*** /dev/null   2001-10-09 18:30:44.000000000 +0200
--- gettext-1/po/remove-potcdate.sin    2002-02-19 02:26:13.000000000 +0100
***************
*** 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
+ }
*** gettext-0/po/Makefile.in.in 2002-02-19 04:35:17.000000000 +0100
--- gettext-1/po/Makefile.in.in 2002-02-19 04:20:24.000000000 +0100
***************
*** 42,48 ****
  GMOFILES = @GMOFILES@
  UPDATEPOFILES = @UPDATEPOFILES@
  DUMMYPOFILES = @DUMMYPOFILES@
! DISTFILES.common = Makefile.in.in Makevars \
  $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) 
$(DISTFILES.common.extra3)
  DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot \
  $(POFILES) $(GMOFILES) \
--- 42,48 ----
  GMOFILES = @GMOFILES@
  UPDATEPOFILES = @UPDATEPOFILES@
  DUMMYPOFILES = @DUMMYPOFILES@
! 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,61 ****
  # Makevars gets inserted here. (Don't remove this line!)
  
  .SUFFIXES:
! .SUFFIXES: .po .gmo .mo .nop .po-update
  
  .po.mo:
        $(MSGFMT) -c -o $@ $<
--- 55,61 ----
  # Makevars gets inserted here. (Don't remove this line!)
  
  .SUFFIXES:
! .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update
  
  .po.mo:
        $(MSGFMT) -c -o $@ $<
***************
*** 66,71 ****
--- 66,75 ----
        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: address@hidden@
  
***************
*** 76,89 ****
  # otherwise packages like GCC can not be built if only parts of the source
  # have been downloaded.
  
! $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in
        $(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 )
  
  $(srcdir)/$(DOMAIN).pot:
        $(MAKE) $(DOMAIN).pot-update
--- 80,104 ----
  # otherwise packages like GCC can not be built if only parts of the source
  # have been downloaded.
  
! $(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 || { \
!         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,228 ****
  dvi info tags TAGS ID:
  
  mostlyclean:
!       rm -f core core.* $(DOMAIN).po *.new.po
        rm -fr *.o
  
  clean: mostlyclean
--- 237,244 ----
  dvi info tags TAGS ID:
  
  mostlyclean:
!       rm -f remove-potcdate.sed
!       rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
        rm -fr *.o
  
  clean: mostlyclean



reply via email to

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