Re: VPATH distcheck build fails

2019-05-04 Thread Bruno Haible
Hi Tim,

> I am possible at the wrong ML now, but see the braking shell code as
> well in gnulib/build-aux/po/Makefile.in.in.

CCing bug-gettext, since that is the more appropriate mailing list.

> The make target '$(DOMAIN).pot-update:' contains this code:
>   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; \
> 
> In a vpath build (using the configure script outside the main project
> directory), the line
>   rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot
> is triggered and thus breaks 'make distcheck'.
> 
> This due to all files in $(srcdir) are read-only.

That piece of Makefile code is careful to not touch $(srcdir)/$(DOMAIN).pot
if $(DOMAIN).1po $(DOMAIN).2po are the same. They are generated through

sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > 
$(DOMAIN).1po && \
sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \

To investigate the cause of this failure, compare the files
wget.po and $(srcdir)/wget.po. They ought to differ only in the 
POT-Creation-Date
line.

Bruno




Re: VPATH distcheck build fails

2019-05-04 Thread Tim Rühsen
Hi Bruno,

On 04.05.19 14:44, Bruno Haible wrote:
> Hi Tim,
> 
>> I am possible at the wrong ML now, but see the braking shell code as
>> well in gnulib/build-aux/po/Makefile.in.in.
> 
> CCing bug-gettext, since that is the more appropriate mailing list.
> 
>> The make target '$(DOMAIN).pot-update:' contains this code:
>>   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; \
>>
>> In a vpath build (using the configure script outside the main project
>> directory), the line
>>   rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot
>> is triggered and thus breaks 'make distcheck'.
>>
>> This due to all files in $(srcdir) are read-only.
> 
> That piece of Makefile code is careful to not touch $(srcdir)/$(DOMAIN).pot
> if $(DOMAIN).1po $(DOMAIN).2po are the same. They are generated through
> 
> sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > 
> $(DOMAIN).1po && \
> sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
> 
> To investigate the cause of this failure, compare the files
> wget.po and $(srcdir)/wget.po. They ought to differ only in the 
> POT-Creation-Date
> line.

That's indeed a good hint...

$ diff wget.po ../../../po/wget.pot
3c3
< # This file is distributed under the same license as the wget package.
---
> # This file is distributed under the same license as the GNU wget package.
9c9
< "Project-Id-Version: wget 1.20.3.13-ee7fe-dirty\n"
---
> "Project-Id-Version: GNU wget 1.20.3.13-ee7fe-dirty\n"
11c11
< "POT-Creation-Date: 2019-05-04 15:31+0200\n"
---
> "POT-Creation-Date: 2019-05-04 15:29+0200\n"

Since "GNU" is correct here, I wonder why is vanishes...

Regards, Tim



signature.asc
Description: OpenPGP digital signature


Re: VPATH distcheck build fails

2019-05-04 Thread Tim Rühsen
On 04.05.19 16:15, Tim Rühsen wrote:
> Hi Bruno,
> 
> On 04.05.19 14:44, Bruno Haible wrote:
>> Hi Tim,
>>
>>> I am possible at the wrong ML now, but see the braking shell code as
>>> well in gnulib/build-aux/po/Makefile.in.in.
>>
>> CCing bug-gettext, since that is the more appropriate mailing list.
>>
>>> The make target '$(DOMAIN).pot-update:' contains this code:
>>>   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; \
>>>
>>> In a vpath build (using the configure script outside the main project
>>> directory), the line
>>>   rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot
>>> is triggered and thus breaks 'make distcheck'.
>>>
>>> This due to all files in $(srcdir) are read-only.
>>
>> That piece of Makefile code is careful to not touch $(srcdir)/$(DOMAIN).pot
>> if $(DOMAIN).1po $(DOMAIN).2po are the same. They are generated through
>>
>> sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > 
>> $(DOMAIN).1po && \
>> sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
>>
>> To investigate the cause of this failure, compare the files
>> wget.po and $(srcdir)/wget.po. They ought to differ only in the 
>> POT-Creation-Date
>> line.
> 
> That's indeed a good hint...
> 
> $ diff wget.po ../../../po/wget.pot
> 3c3
> < # This file is distributed under the same license as the wget package.
> ---
>> # This file is distributed under the same license as the GNU wget package.
> 9c9
> < "Project-Id-Version: wget 1.20.3.13-ee7fe-dirty\n"
> ---
>> "Project-Id-Version: GNU wget 1.20.3.13-ee7fe-dirty\n"
> 11c11
> < "POT-Creation-Date: 2019-05-04 15:31+0200\n"
> ---
>> "POT-Creation-Date: 2019-05-04 15:29+0200\n"
> 
> Since "GNU" is correct here, I wonder why is vanishes...

Some lines above there is
if LC_ALL=C grep 'GNU wget' ../../../* 2>/dev/null | grep -v 'libtool:'
>/dev/null; then \
  package_gnu='GNU '; \
else \
  package_gnu=''; \
fi; \

As it turns out:
  LC_ALL=C grep 'GNU wget' /../../*
has zero output.

Using grep -i then shows several 'GNU Wget' occurrences.

In 'configure.ac' we have "AC_INIT([wget]...".

I think we'll have to change it to "AC_INIT([Wget]...", hope there are
no hidden side effects.

Thanks for your help !

Regards, Tim



signature.asc
Description: OpenPGP digital signature


Re: VPATH distcheck build fails

2019-05-04 Thread Bruno Haible
Tim Rühsen wrote:
> $ diff wget.po ../../../po/wget.pot
> 3c3
> < # This file is distributed under the same license as the wget package.
> ---
> > # This file is distributed under the same license as the GNU wget package.
> 9c9
> < "Project-Id-Version: wget 1.20.3.13-ee7fe-dirty\n"
> ---
> > "Project-Id-Version: GNU wget 1.20.3.13-ee7fe-dirty\n"

The determination whether a package is a GNU package or not is a bit
unreliable. To fix this, set the PACKAGE_GNU variable in your
po/Makevars:

# This tells whether or not to prepend "GNU " prefix to the package
# name that gets inserted into the header of the $(DOMAIN).pot file.
# Possible values are "yes", "no", or empty.  If it is empty, try to
# detect it automatically by scanning the files in $(top_srcdir) for
# "GNU packagename" string.
PACKAGE_GNU = yes


Bruno




Re: VPATH distcheck build fails

2019-05-04 Thread Tim Rühsen
On 04.05.19 16:25, Bruno Haible wrote:
> Tim Rühsen wrote:
>> $ diff wget.po ../../../po/wget.pot
>> 3c3
>> < # This file is distributed under the same license as the wget package.
>> ---
>>> # This file is distributed under the same license as the GNU wget package.
>> 9c9
>> < "Project-Id-Version: wget 1.20.3.13-ee7fe-dirty\n"
>> ---
>>> "Project-Id-Version: GNU wget 1.20.3.13-ee7fe-dirty\n"
> 
> The determination whether a package is a GNU package or not is a bit
> unreliable. To fix this, set the PACKAGE_GNU variable in your
> po/Makevars:
> 
> # This tells whether or not to prepend "GNU " prefix to the package
> # name that gets inserted into the header of the $(DOMAIN).pot file.
> # Possible values are "yes", "no", or empty.  If it is empty, try to
> # detect it automatically by scanning the files in $(top_srcdir) for
> # "GNU packagename" string.
> PACKAGE_GNU = yes

Thanks, Bruno.

That seems much better than changing AC_INIT in configure.ac.

Regards, Tim



signature.asc
Description: OpenPGP digital signature


Re: VPATH distcheck build fails

2019-05-04 Thread Tim Rühsen


On 04.05.19 16:26, Tim Rühsen wrote:
> On 04.05.19 16:25, Bruno Haible wrote:
>> Tim Rühsen wrote:
>>> $ diff wget.po ../../../po/wget.pot
>>> 3c3
>>> < # This file is distributed under the same license as the wget package.
>>> ---
 # This file is distributed under the same license as the GNU wget package.
>>> 9c9
>>> < "Project-Id-Version: wget 1.20.3.13-ee7fe-dirty\n"
>>> ---
 "Project-Id-Version: GNU wget 1.20.3.13-ee7fe-dirty\n"
>>
>> The determination whether a package is a GNU package or not is a bit
>> unreliable. To fix this, set the PACKAGE_GNU variable in your
>> po/Makevars:
>>
>> # This tells whether or not to prepend "GNU " prefix to the package
>> # name that gets inserted into the header of the $(DOMAIN).pot file.
>> # Possible values are "yes", "no", or empty.  If it is empty, try to
>> # detect it automatically by scanning the files in $(top_srcdir) for
>> # "GNU packagename" string.
>> PACKAGE_GNU = yes
> 
> Thanks, Bruno.
> 
> That seems much better than changing AC_INIT in configure.ac.

Both, 'po/Makevars' and 'po/Makevars.template' are overwritten by
'./bootstrap' (the gnulib bootstrap) (adding to git doesn't matter).

We use gnulib module 'gettext-h' but not 'gettext', in configure.ac there is
AM_GNU_GETTEXT([external],[need-ngettext])
AM_GNU_GETTEXT_VERSION([0.17])

Sorry, but I'm a bit puzzled here.

Regards, Tim



signature.asc
Description: OpenPGP digital signature


Re: VPATH distcheck build fails

2019-05-04 Thread Bruno Haible
Tim Rühsen wrote:
> Both, 'po/Makevars' and 'po/Makevars.template' are overwritten by
> './bootstrap' (the gnulib bootstrap) (adding to git doesn't matter).

po/Makevars is meant to contain *package-specific* customizations
of the gettext integration.

If 'bootstrap' overwrites it, surely it has a way to override this
behaviour (in bootstrap.conf)?

Bruno




Re: VPATH distcheck build fails

2019-05-04 Thread Tim Rühsen
On 04.05.19 18:13, Bruno Haible wrote:
> Tim Rühsen wrote:
>> Both, 'po/Makevars' and 'po/Makevars.template' are overwritten by
>> './bootstrap' (the gnulib bootstrap) (adding to git doesn't matter).
> 
> po/Makevars is meant to contain *package-specific* customizations
> of the gettext integration.
> 
> If 'bootstrap' overwrites it, surely it has a way to override this
> behaviour (in bootstrap.conf)?

Nothing documented found. After reading some code, it seems po/Makevars
is left alone when removing AM_GNU_GETTEXT_VERSION([0.17]) from
configure.ac. Good, but now I am back at the original reported error :-(

The wget.po created in the vpath build still contains just 'wget'
instead of 'GNU Wget' due to

if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null |
grep -v 'libtool:' >/dev/null; then \
  package_gnu='GNU '; \
else \
  package_gnu=''; \
fi; \

That is, package_gnu is empty due to not finding 'GNU wget' in the main
project/tarball dir.

Of course I could just generate a file with such a signature, but it
feels like a hack. And I wonder how other GNU projects do it. GNU Wget2
has the same issue. GNU Libidn2 names itself just 'libidn2' everywhere -
so the 'cmp' works (by random).

Thank you for your patience and time, Bruno.

Regards, Tim



signature.asc
Description: OpenPGP digital signature


Re: VPATH distcheck build fails

2019-05-04 Thread Bruno Haible
Tim Rühsen wrote:
> Nothing documented found. After reading some code, it seems po/Makevars
> is left alone when removing AM_GNU_GETTEXT_VERSION([0.17]) from
> configure.ac.

The Makefile.in.in from version 0.17 did not contain the support for
the PACKAGE_GNU customization. You need at least
  AM_GNU_GETTEXT_VERSION([0.19])
for that.

> The wget.po created in the vpath build still contains just 'wget'
> instead of 'GNU Wget' due to
> 
> if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null |
> grep -v 'libtool:' >/dev/null; then \
>   package_gnu='GNU '; \
> else \
>   package_gnu=''; \
> fi; \
> 
> That is, package_gnu is empty due to not finding 'GNU wget' in the main
> project/tarball dir.

You are repeating yourself. I told you already that this heuristic is
not reliable, and the way to avoid the heuristic is to add a po/Makevars
that contains
  PACKAGE_GNU = yes

Bruno




Re: VPATH distcheck build fails

2019-05-05 Thread Tim Rühsen
Hi Bruno,

On 05.05.19 02:24, Bruno Haible wrote:
> Tim Rühsen wrote:
>> Nothing documented found. After reading some code, it seems po/Makevars
>> is left alone when removing AM_GNU_GETTEXT_VERSION([0.17]) from
>> configure.ac.
> 
> The Makefile.in.in from version 0.17 did not contain the support for
> the PACKAGE_GNU customization. You need at least
>   AM_GNU_GETTEXT_VERSION([0.19])
> for that.
> 
>> The wget.po created in the vpath build still contains just 'wget'
>> instead of 'GNU Wget' due to
>>
>> if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null |
>> grep -v 'libtool:' >/dev/null; then \
>>   package_gnu='GNU '; \
>> else \
>>   package_gnu=''; \
>> fi; \
>>
>> That is, package_gnu is empty due to not finding 'GNU wget' in the main
>> project/tarball dir.
> 
> You are repeating yourself. I told you already that this heuristic is
> not reliable, and the way to avoid the heuristic is to add a po/Makevars
> that contains
>   PACKAGE_GNU = yes

Right, but as I said that finally ends in a loop, that's why I was
repeating that fact. Sorry, it wasn't meant to annoy you (or as any kind
of rant).

To break the "loop" it is indeed necessary to increase the gettext
version. Thanks for pointing this out.

Regards, Tim



signature.asc
Description: OpenPGP digital signature