[Aptitude-devel] Bug#967911: aptitude: aptitude-changelog-parser leaves garbage on the screen

Guillem Jover guillem at debian.org
Tue Aug 4 19:56:40 BST 2020


Control: tags -1 patch

Hi!

On Tue, 2020-08-04 at 20:09:05 +0200, Sven Joachim wrote:
> Package: aptitude
> Version: 0.8.13-1+b1
> Severity: normal
> X-Debbugs-Cc: Sven Joachim <svenjoac at gmx.de>, Guillem Jover <guillem at debian.org>

> When viewing the Debian changelog of bash in aptitude's TUI, I saw the
> screen flash and then error messages from aptitude-changelog-parser
> appeared scattered across the screen, redrawing the screen with Ctrl-l
> got rid of these and displayed the changelog properly.
> 
> The bash changelog has at least two incorrectly formatted entries for
> versions 2.01.1-3.1 and 2.01-0 which aptitude-changelog-parser
> apparently complains about.

Right these are the warnings from the Dpkg::Changelog parser:

  ,---
  Redundant argument in sprintf at /usr/share/perl5/Dpkg/Changelog/Entry/Debian.pm line 228, <$filehandle> line 2373.
  aptitude-changelog-parser: warning:       bash.changelog(l2373): uses full instead of abbreviated month name 'July'
  LINE:  -- Joel Klecker <jk at espy.org>  Tue, 14 July 1998 16:26:43 -0700
  aptitude-changelog-parser: warning:       bash.changelog(l2373): cannot parse non-conformant date '14 July 1998 16:26:43 -0700'
  LINE:  -- Joel Klecker <jk at espy.org>  Tue, 14 July 1998 16:26:43 -0700
  aptitude-changelog-parser: warning:       bash.changelog(l2484): ignoring invalid week day 'Thur'
  LINE:  -- James Troup <jjtroup at comp.brad.ac.uk>  Thur, 19 June 1997 19:13:34 +0100
  aptitude-changelog-parser: warning:       bash.changelog(l2484): invalid abbreviated month name 'June'
  LINE:  -- James Troup <jjtroup at comp.brad.ac.uk>  Thur, 19 June 1997 19:13:34 +0100
  aptitude-changelog-parser: warning:       bash.changelog(l2484): cannot parse non-conformant date '19 June 1997 19:13:34 +0100'
  LINE:  -- James Troup <jjtroup at comp.brad.ac.uk>  Thur, 19 June 1997 19:13:34 +0100
  `---

So, there's an actual issue with the Dpkg::Changelog::Entry::Debian
code, which I'll be fixing. Then the bash changelog, would be nice to
get fixed too in bash.

> Viewing the changelog from the commandline with "aptitude changelog
> bash" does not show such a problem, though.

I guess the TUI is not ignoring stderr, while the CLI invocation is?
Although that means that if the libdpkg-perl package is not installed,
there will be no warning helping the user along, so it would be nice
to get the CLI to not ignore the warnings for consistency?

In any case, Dpkg::Changelog defaults to printing these parsing
problems as warnings, but there is no way to pass a «verbose => 0» via
changelog_parse(). I'll add support for that too.

For the aptitude-changelog-parser, it could be modified for now to
quiesce late warnings like in the attached patch.

Thanks,
Guillem
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-aptitude-changelog-parser-Quiesce-Dpkg-Changelog-par.patch
Type: text/x-diff
Size: 1097 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/aptitude-devel/attachments/20200804/205b8485/attachment.patch>


More information about the Aptitude-devel mailing list