Hi!

On Tue, 2020-08-04 at 20:56:48 +0200, Guillem Jover wrote:
> Control: tags -1 patch

> 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 <svenj...@gmx.de>, Guillem Jover 
> > <guil...@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.
 
> > 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.

This is now supported since dpkg 1.20.6, so I'm attaching the updated
patch.

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

And the old can should then be ignored.

Thanks,
Guillem
From 8510e847c035f70e28ce63ff74b824c39892f602 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@debian.org>
Date: Tue, 4 Aug 2020 20:51:44 +0200
Subject: [PATCH] aptitude-changelog-parser: Quiesce Dpkg::Changelog parse
 warnings

The Dpkg::Changelog object gets initialized with verbose mode set to 1,
so all parsing warnings get printed on stderr, which messes up the
output when showing the changelogs from the TUI.

Starting with libdpkg-perl 1.20.6 we can change the verbose mode when
calling changelog_parse() from Dpkg::Changelog::Parse.
---
 aptitude-changelog-parser | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/aptitude-changelog-parser b/aptitude-changelog-parser
index aee1dfd1..63ff6a4f 100755
--- a/aptitude-changelog-parser
+++ b/aptitude-changelog-parser
@@ -24,4 +24,4 @@ if (scalar @ARGV == 1) {
     $opts{all} = undef;
 }
 
-print join "\n", changelog_parse(format => 'rfc822', %opts);
+print join "\n", changelog_parse(format => 'rfc822', verbose => 0, %opts);
-- 
2.33.1

_______________________________________________
Aptitude-devel mailing list
Aptitude-devel@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/aptitude-devel

Reply via email to