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

2024-01-06 Thread Niels Thykier
On Sat, 06 Jan 2024 00:27:02 +0100 Martin Quinson 
 wrote:
> I believe the libdpkg-perl package has a dpkg parser that handles the 
> basic parsing.
> 


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




For the record, the module is also on CPAN 
(https://metacpan.org/pod/Dpkg) in case that makes the situation easier 
to resolve.


Best regards,
Niels



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

2024-01-05 Thread Niels Thykier

Martin Quinson:

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


Hi Martin

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


Best regards,
Niels



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

2024-01-05 Thread Martin Quinson
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


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


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

2012-03-08 Thread Niels Thykier
Package: po4a
Severity: minor

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=...
Check-Script: group-checks
Author: Niels Thykier ni...@thykier.net
Abbrev: gchck
# This is a source check, so we only run it once per group
Type: source
Info: This script checks for some issues that may appear in packages
 built from the same source.  This includes intra-source circular
 dependencies and intra-source priority checks.

Tag: intra-source-package-circular-dependency
Severity: normal
Certainty: certain
Info: The listed packages from the same source circularly depend
 (or pre-depend) on each other.  This makes it difficult for tools
 to properly handle install/upgrade sequences.  Furthermore this
 complicates automated removal of unused packages.
 .
 If possible, consider removing or reducing one of the depends.
 .
 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.
Ref: policy 7.2

Tag: package-depends-on-lower-priority-package
Severity: normal
Certainty: certain
Ref: policy 2.5, http://qa.debian.org/debcheck.php
Info: The package depends on a package with lower priority than
 itself.
 .
 Note: This check is limited to packages created from the same source
 package.  A full check of all dependencies built from different
 source packages is beyond the scope of Lintian.  The depcheck service
 can do this.

Tag: binaries-have-file-conflict
Severity: normal
Certainty: possible
Experimental: no
Info: The binaries appears to have overlapping files without proper
 conflicts relation.
 .
 Note the check is completely based on the file index for the
 packages.  Possible known false-positives include dpkg-diverts in
 maintainer scripts.

Tag: dependency-is-not-multi-archified
Severity: normal
Certainty: possible
Info: The package is Multi-Arch same, but it depends on a package that
 is neither Multi-Arch same nor foreign.
Ref: https://wiki.ubuntu.com/MultiarchSpec