Re: Implementing notrans_man_MANS

2008-03-06 Thread Peter Breitenlohner

On Thu, 6 Mar 2008, Ralf Wildenhues wrote:


Also, the whole thing would probably be a lot more readable if the
?NOTR?/?DOTR? prefixes vanished and were replaced by full rules, wrapped
in `if %?NOTRANS_MANS%'.  That would be a better name for NOTR, and
since it would then only appear a couple of times, it could be longer
without pain, too.



Do you mean something like:
install-man: install-man1 install-notrans-man1
install-man1: trans_DEPENDENCIES
trans_RULES
install-notrans-man1: notrans_DEPENDENCIES
notrans_RULES


No.


Hi Ralf,

what then? Maybe this:

if only trans
install-man1: trans_DEPENDENCIES
trans_RULES
as before, if only notrans
install-man1: notrans_DEPENDENCIES
notrans_RULES
or if both are present
install-man1: trans_DEPENDENCIES notrans_DEPENDENCIES
trans_RULES
notrans_RULES

Pro: much simpler to read
Con: duplication of code, harder to maintain

or still something else. If so please indicate what.

Regards,
Peter




Re: Implementing notrans_man_MANS

2008-03-06 Thread Peter Breitenlohner

On Wed, 5 Mar 2008, Ralf Wildenhues wrote:


Well, here's a review of your patches.  If you have time to address the
comments, that would be great, otherwise I will eventually do it.


Hi Ralf,

I will go through your comments and think most of them pose no problem. For
the moment just a few remarks/questions:


This triple loop is already at 72 iterations.  Not good for performance.
If this grows further, we may have to access variables in a different
manner here.


I assume you are worried by the total number of 72 iterations, not by the
fact that they come from three nested loops.  Given the Automake
infrastructure (to the extent I understand it) I see no alternative.


+?NOTRY?l2='%NOTRZ%'; \
+?NOTRY?for i in $$l2; do \
...
+?NOTR?   $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man%SECTION%dir)/$$inst"; \
+?NOTR? done


Note to self: should rewrite the above when applying the multi-file
install.


What is multi-file install? Maybe I don't need to know.


Also, the whole thing would probably be a lot more readable if the
?NOTR?/?DOTR? prefixes vanished and were replaced by full rules, wrapped
in `if %?NOTRANS_MANS%'.  That would be a better name for NOTR, and
since it would then only appear a couple of times, it could be longer
without pain, too.


I have tried to wrap the make rule fragments by something like
`if %?XXX%' but failed, maybe I got the syntax wrong.  However, from
some comments elsewhere I concluded that at present this is not possible.

Do you mean something like:
install-man: install-man1 install-notrans-man1
install-man1: trans_DEPENDENCIES
trans_RULES
install-notrans-man1: notrans_DEPENDENCIES
notrans_RULES

That should not be too difficult. Shall I try it?


[EMAIL PROTECTED] must be specified first when used in conjunction with
+either @samp{dist_} or @samp{nodist_} (@pxref{Dist}).  For instance:


Can this limitation be lifted (without making the code much slower)?


I wouldn't know how, and there is an analogous limitation elsewhere:
nobase_dist_pkgdata_DATA


+./configure --program-prefix=gnu- --prefix `pwd`/inst --mandir `pwd`/inst/man


Please quote instances of `pwd' for the master testsuite.


Like --prefix "`pwd`"/inst for Windows paths containing spaces? I just
copied this from transform.test. A quick grep shows there are still plenty
of unquoted pwd's around.

BTW: Which one is better: `--prefix PREFIX' or `--prefix=PREFIX'?

==

In the meantime I have some ideas how to handle manpage translations. Mainly
an Autoconf/Automake macro and Makefile.am stuff, plus a little bit of help
from Automake.  To whom should I send this, when finished to write it up?

Regards Peter




Re: Implementing notrans_man_MANS

2008-03-06 Thread Ralf Wildenhues
Hi Peter,

* Peter Breitenlohner wrote on Thu, Mar 06, 2008 at 10:43:20AM CET:
> On Wed, 5 Mar 2008, Ralf Wildenhues wrote:
>
>> This triple loop is already at 72 iterations.  Not good for performance.
>> If this grows further, we may have to access variables in a different
>> manner here.
>
> I assume you are worried by the total number of 72 iterations, not by the
> fact that they come from three nested loops.  Given the Automake
> infrastructure (to the extent I understand it) I see no alternative.

Your assumption is correct, and yes, I don't see a simple alternative
either.

>>> +?NOTRY?l2='%NOTRZ%'; \
>>> +?NOTRY?for i in $$l2; do \
>>> ...
>>> +?NOTR?   $(INSTALL_DATA) "$$file" 
>>> "$(DESTDIR)$(man%SECTION%dir)/$$inst"; \
>>> +?NOTR? done
>>
>> Note to self: should rewrite the above when applying the multi-file
>> install.
>
> What is multi-file install? Maybe I don't need to know.

You don't need to know, but I meant this:


>> Also, the whole thing would probably be a lot more readable if the
>> ?NOTR?/?DOTR? prefixes vanished and were replaced by full rules, wrapped
>> in `if %?NOTRANS_MANS%'.  That would be a better name for NOTR, and
>> since it would then only appear a couple of times, it could be longer
>> without pain, too.
>
> I have tried to wrap the make rule fragments by something like
> `if %?XXX%' but failed, maybe I got the syntax wrong.  However, from
> some comments elsewhere I concluded that at present this is not possible.

It is possible but only if you wrap whole rules.  You cannot wrap parts.
See depend2.am for examples.

> Do you mean something like:
>   install-man: install-man1 install-notrans-man1
>   install-man1: trans_DEPENDENCIES
>   trans_RULES
>   install-notrans-man1: notrans_DEPENDENCIES
>   notrans_RULES

No.

>>> [EMAIL PROTECTED] must be specified first when used in conjunction with
>>> +either @samp{dist_} or @samp{nodist_} (@pxref{Dist}).  For instance:
>>
>> Can this limitation be lifted (without making the code much slower)?
>
> I wouldn't know how, and there is an analogous limitation elsewhere:
> nobase_dist_pkgdata_DATA

Ah ok, I wasn't aware of that.

>>> +./configure --program-prefix=gnu- --prefix `pwd`/inst --mandir 
>>> `pwd`/inst/man
>>
>> Please quote instances of `pwd' for the master testsuite.
>
> Like --prefix "`pwd`"/inst for Windows paths containing spaces? I just
> copied this from transform.test. A quick grep shows there are still plenty
> of unquoted pwd's around.

Not if you look in git master of Automake.

> BTW: Which one is better: `--prefix PREFIX' or `--prefix=PREFIX'?

Both are accepted.

> In the meantime I have some ideas how to handle manpage translations. Mainly
> an Autoconf/Automake macro and Makefile.am stuff, plus a little bit of help
> from Automake.  To whom should I send this, when finished to write it up?

Respective bits to auto{conf,[EMAIL PROTECTED], please.

Thanks,
Ralf




Re: Implementing notrans_man_MANS

2008-03-06 Thread Ralf Wildenhues
* Peter Breitenlohner wrote on Thu, Mar 06, 2008 at 01:27:05PM CET:
> On Thu, 6 Mar 2008, Ralf Wildenhues wrote:
>
 Also, the whole thing would probably be a lot more readable if the
 ?NOTR?/?DOTR? prefixes vanished and were replaced by full rules, wrapped
 in `if %?NOTRANS_MANS%'.  That would be a better name for NOTR, and
 since it would then only appear a couple of times, it could be longer
 without pain, too.
>>
>>> Do you mean something like:
>>> install-man: install-man1 install-notrans-man1
>>> install-man1: trans_DEPENDENCIES
>>> trans_RULES
>>> install-notrans-man1: notrans_DEPENDENCIES
>>> notrans_RULES
>>
>> No.

> what then? Maybe this:
>
> if only trans
>   install-man1: trans_DEPENDENCIES
>   trans_RULES
> as before, if only notrans
>   install-man1: notrans_DEPENDENCIES
>   notrans_RULES
> or if both are present
>   install-man1: trans_DEPENDENCIES notrans_DEPENDENCIES
>   trans_RULES
>   notrans_RULES
>
> Pro: much simpler to read
> Con: duplication of code, harder to maintain
>
> or still something else. If so please indicate what.

Oh sorry, I was in a hurry and not thinking.  What I meant was that
while you can't wrap arbitrary lines ending in backslash-newline in `if
%?NOTRANS_MANS%/else/endif', you can do so at a finer grainage than
whole rules: it's just that it won't work after lines ending in
backslash.

To some extent this is independent of the question you ask about the
rule target names: whether you interleave trans and notrans in the .am
file and whether you give trans and notrans different target names need
not be dealt with at the same time.  So please for now leave you patch
as is, but only change all those NOTR/DOTR prefixes to use if/else/endif
(which includes a few lines of duplication in the .am file).

Clearer now?  If not, then I guess I can also patch that later.

Thanks,
Ralf