#663148 po4a: Text (-o control=...) chokes on a normal dctrl file

#663148#5
Date:
2012-03-08 21:40:03 UTC
From:
To:
Hi,

po4a's Debian Control parser[1] in SVN chokes on a control file
(attached) that I believe has no syntax errors:

"""
$ PERL5LIB=po4a/ po4a-gettextize -f text -m checks/group-checks.desc -p po4a/po/group-checks.pot  -o control=Info
Unrecognized section: '# This is a source check, so we only run it once per group
'
Unrecognized section: ' Note: This check is limited to packages created from the same
 source package.  Full circular dependencies between binaries from
 different source packages is beyond the scope of Lintian.
'
Unrecognized section: ' is neither Multi-Arch "same" nor "foreign".
"""

The first error is because the parser chokes on a "comment" in the
file, and the source suggests this is due to a lack of support for
these.  It would be nice (but not needed) to have that.

However, the last two errors I do not understand.

David Pr��vot (taffit) also mentioned the following:

"""
21:37 < taffit> Mmm, it also assumes a short description on the
first line, followed by a long one in the following text, which is not
the case in your file (might exist a setting for that)
"""

I had a brief look at the source, but I could not find such a setting.

~Niels


[1] That is, -f text -o control=...

#663148#10
Date:
2024-01-05 10:48:08 UTC
From:
To:
Hello,

I am sorry I didn't answer to this bug in all these years...

The support for Deb822 files seems very limited right now. Beside of the bug
you reported, it fails to handle folded entries, as your Info: fields where the
first line is not specific and should be added to the content afterward.
Comments are also badly handled. Etc etc.

I think that the best would be to reimplement it from scratch. I'm not a big
fan of reimplementing things from scratch, but the existing po4a parser for
control files is 50 lines long only. Not a big loss.

Do you guys know a good and simple parser of such files that would be written
in Perl? If it's a library I'd reuse it, and if it's part of another program
I'd copy/paste and adapt it to our use case. Given the time I can devote to
this project despite IRL, I need to be efficient.

Thanks, and sorry for the delay,
Mt

#663148#13
Date:
2024-01-05 10:48:08 UTC
From:
To:
Hello,

I am sorry I didn't answer to this bug in all these years...

The support for Deb822 files seems very limited right now. Beside of the bug
you reported, it fails to handle folded entries, as your Info: fields where the
first line is not specific and should be added to the content afterward.
Comments are also badly handled. Etc etc.

I think that the best would be to reimplement it from scratch. I'm not a big
fan of reimplementing things from scratch, but the existing po4a parser for
control files is 50 lines long only. Not a big loss.

Do you guys know a good and simple parser of such files that would be written
in Perl? If it's a library I'd reuse it, and if it's part of another program
I'd copy/paste and adapt it to our use case. Given the time I can devote to
this project despite IRL, I need to be efficient.

Thanks, and sorry for the delay,
Mt

#663148#18
Date:
2024-01-05 10:11:01 UTC
From:
To:
Martin Quinson:

Hi Martin

I believe the libdpkg-perl package has a dpkg parser that handles the
basic parsing.

Best regards,
Niels

#663148#23
Date:
2024-01-05 10:11:01 UTC
From:
To:
Martin Quinson:

Hi Martin

I believe the libdpkg-perl package has a dpkg parser that handles the
basic parsing.

Best regards,
Niels

#663148#26
Date:
2024-01-05 10:11:01 UTC
From:
To:
Martin Quinson:

Hi Martin

I believe the libdpkg-perl package has a dpkg parser that handles the
basic parsing.

Best regards,
Niels

#663148#31
Date:
2024-01-05 23:27:02 UTC
From:
To:
Indeed, I think that the parser in /usr/share/perl5/Dpkg/Control/HashCore.pm
would cover my needs. I'm still unsure of whether I should use this parser as
is, or copy/paste the code. The second is always crude, but the first one may
be difficult on non-Debian systems, as dpkg is meant to embeed all its
dependency to reduce bootstraping issues.

Anyway, I'm running out of time on po4a for this time and mostly write it down
for future reference.

Thanks for the fish,
Mt