Bug#986840: apt-listchanges fails to parse status files with ^M characters; should use apt_pkg.TagFile, not write its own parser

2021-07-01 Thread Brian Thompson
> As reported in
> https://bugs.launchpad.net/ubuntu/+source/apt-listchanges/+bug/1854772,
> apt-listchanges
> fails to parse status files that contain carriage return characters, as
> Python normalizes the line endings.

I'm tracking the downstream bug in Ubuntu as well as this one.

> Instead of writing its own ad-hoc parser, apt-listchanges should use
> apt_pkg.TagFile instead.

I did a little bit of digging into how to rewrite the parser with your
suggested changes.  I agree that apt-listchanges should not be using its
own parser, especially since a standardized one exists in apt_pkg.

Preliminarily, I have these changes in mind for
apt_listchanges.ControlParser.readfile() (spacing adjusted for brevity):

```python
...
try:
  with apt_pkg.TagFile(file) as tagfile:
for section in tagfile:
  self.stanzas += [ControlStanza(x) for x in section]
except: ...  
```

There also, at the very least, may need a change to be made to
apt_listchanges.DebianFiles.ControlParser.readdeb() as well.  I'm hoping 
that we can avoid rewriting some of the classes in
apt_listchanges.DebianFiles, namely ControlParser and ControlStanza.

If you have suggestions on how the change would look, please let me
know.

-- 
Best regards,

Brian T


signature.asc
Description: PGP signature


Bug#986840: apt-listchanges fails to parse status files with ^M characters; should use apt_pkg.TagFile, not write its own parser

2021-07-01 Thread Brian Thompson
Julian,

I didn't see that you cloned this bug and assigned it to dpkg and that
the bug is no longer in apt-listchanges.  I still think that your
original proposal for apt-listchanges is relevant and is a change worth
making.
-- 
Best regards,

Brian T


signature.asc
Description: PGP signature


Processed: apt-listchanges #984538 add tags: wishlist

2021-07-01 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> severity 984538 wishlist
Bug #984538 [apt-listchanges] Upstream changelog does not appear
Severity set to 'wishlist' from 'normal'
> thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
984538: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=984538
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Processed: apt-listchanges #984538 add tags: experimental

2021-07-01 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> tags 984538 experimental
Bug #984538 [apt-listchanges] Upstream changelog does not appear
Added tag(s) experimental.
> thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
984538: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=984538
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#939287: Add urgency level separators

2021-07-01 Thread Brian Thompson
On Tue, 03 Sep 2019 03:37:58 +0800 =?utf-8?B?56mN5Li55bC8?= Dan
Jacobson  wrote:
> Man page says 'The groups are sorted by the urgency of the most urgent
> change, and than by the package name.'
> 
> Alas, that looks like
> 
> A
> B
> C
> A
> B
> A
> B
> 
> to the user. So perhaps add
> 
> --urgency=high:
> A
> B
> C
> --urgency=medium:
> A
> B
> --urgency=low:
> A
> B
> 
> separators, so it would all make sense.

I like the change you proposed.  I don't think that would be too hard to
do given that the changes are already sorted in order.  This would
definitely improve readability IMO.
-- 
Best regards,

Brian T


signature.asc
Description: PGP signature