Hello,

a first quick check on the provided file raises a proper error:

$ PERL5LIB=lib/ ./po4a-normalize -f man /tmp/toggle.9
po4a-normalize is mostly useful to debug po4a itself. Users are advised to use 
the po4a(1) program instead.
/tmp/toggle.9:19: (po4a::man)
               This page uses conditionals with '.ie'. Since po4a is not a real 
groff parser, this is not supported by default. The option 
               'groff_code=verbatim' gets these macros copied verbatim in the 
translated file, but it's not very robust. 'groff_code=translate' 
               shows these macros to the translators, but groff macros are not 
user-friendly for translators.

The file used in this test is the one you provide in your bug report. The po4a
version used is the git one, but there was not change since 0.73 on the Man
module. The difference between 0.69 and 0.73 wtr seems to be
https://github.com/mquinson/po4a/issues/361

Could you please check whether your problem is "fixed" with the 0.73 version? 
If not, I'll try to find the time to dig into your repository properly. 

In any case, I'm rather reluctant to implement a proper support for
conditionals in po4a, as it would request to implement a complete groff
interpreter. Of course, I'd accept proper patches going in that direction.

Sorry about that, and thanks for your interest,
Mt

Le dimanche 21 juillet 2024 à 10:00 +0200, Petter Reinholdtsen a écrit :
> 
> Package: po4a
> Version: 0.69-1
> 
> We ran into a problem with po4a on LinuxCNC,
> <URL: https://github.com/linuxcnc/linuxcnc/ >. The issue is po4a going
> into a seemingly endless loop print lines like these:
> 
>   Use of uninitialized value $line in scalar chomp at
>     /usr/share/perl5/Locale/Po4a/Man.pm line 2344.
>   Use of uninitialized value $line in concatenation (.) or string at
>     /usr/share/perl5/Locale/Po4a/Man.pm line 2345.
>   Use of uninitialized value $line in pattern match (m//) at
>     /usr/share/perl5/Locale/Po4a/Man.pm line 2346. 
>   Use of uninitialized value $line in pattern match (m//) at
>     /usr/share/perl5/Locale/Po4a/Man.pm line 2347.
> 
> It was triggered by adding .ie to some generated groff files in
> <URL:
> https://github.com/LinuxCNC/linuxcnc/commit/d1414e63eb19f2ebb6c300ea40b4404869c516a3
>  >,
> causing docs/man/man9/toggle.9 and docs/man/man9/toggle2nist.9 to
> confuse po4a.
> We have applied a fix by commenting out the files in docs/po4a.cfg.
> 
> To trigger the error, just uncomment the lines, touch one of the adoc
> files in docs/src/ (for example docs/src/config/ini-config.adoc) and run
> 'debuild'.
> 
> One of the problematic files, toggle.9, look like this:
> 
> ==========================================================================
> .\" -*- mode: troff; coding: utf-8 -*-
> .\"*******************************************************************
> .\"
> .\" This file was extracted from hal/components/toggle.comp using
> halcompile.g.
> .\" Modify the source file.
> .\"
> .\"*******************************************************************
> 
> .TH TOGGLE "9" "2024-07-21" "LinuxCNC Documentation" "HAL Component"
> .SH NAME
> 
> toggle \- 'push-on, push-off' from momentary pushbuttons
> .SH SYNOPSIS
> .HP
> .B loadrt toggle [count=\fIN\fB|names=\fIname1\fB[,\fIname2...\fB]]
> .SH DESCRIPTION
> 
> 
> .ie '\*[.T]'html' \{ .HTML <tt> \}
> \[u00A0]\[u00A0]\[u00A0]\[u00A0]\[u00A0]\[u2510]\[u00A0]\[u00A0]\[u00A0]\[u00
> A0]\[u00A0]\[u250C]\[u2500]\[u2500]\[u2510]\[u00A0]\[u00A0]\[u00A0]\[u00A0]\[
> u00A0]\[u00A0]\[u00A0]\[u00A0]\[u250C]\[u2500]\[u2500]\[u2510]
> .br
> in\[u00A0]:\[u00A0]\[u2514]\[u2500]\[u2500]\[u2500]\[u2500]\[u2500]\[u2518]\[
> u00A0]\[u00A0]\[u2514]\[u2500]\[u2500]\[u2500]\[u2500]\[u2500]\[u2500]\[u2500
> ]\[u2500]\[u2518]\[u00A0]\[u00A0]\[u2514]\[u2500]\[u2500]
> .br
> \[u00A0]\[u00A0]\[u00A0]\[u00A0]\[u00A0]\[u2510]\[u00A0]\[u00A0]\[u00A0]\[u00
> A0]\[u00A0]\[u250C]\[u2500]\[u2500]\[u2500]\[u2500]\[u2500]\[u2500]\[u2500]\[
> u2500]\[u2500]\[u2500]\[u2500]\[u2510]
> .br
> out:\[u00A0]\[u2514]\[u2500]\[u2500]\[u2500]\[u2500]\[u2500]\[u2518]\[u00A0]\
> [u00A0]\[u00A0]\[u00A0]\[u00A0]\[u00A0]\[u00A0]\[u00A0]\[u00A0]\[u00A0]\[u00A
> 0]\[u2514]\[u2500]\[u2500]\[u2500]\[u2500]\[u2500]
> .ie '\*[.T]'html' \{ .HTML </tt> \}
> 
> .SH FUNCTIONS
> .TP
> \fBtoggle.\fIN\fB\fR
> 
> .SH PINS
> .TP
> .B toggle.\fIN\fB.in\fR bit in \fR
> button input
> .TP
> .B toggle.\fIN\fB.out\fR bit io \fR
> on/off output
> .SH PARAMETERS
> .TP
> .B toggle.\fIN\fB.debounce\fR u32 rw \fR(default: \fI2\fR)
> debounce delay in periods
> .SH AUTHOR
> 
> John Kasunich
> .SH LICENSE
> 
> GPL
> ==========================================================================
> 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to