Hi,

Apologies for my lack of movement on this bug recently, I have become
rather stuck.

I am attaching what I have so far so it does not get lost. It is a
python script that creates the index files used by apt-listbugs from the
output of apt-listbugs. It is in python as perl's LDIF parser doesn't
handle mulitple fields (e.g. debbugsAffected). I'm not sure if ruby
(like the rest of apt-listbugs can do it).

It should not be too difficult to generate the bug files that are also
used from this information as well, I just haven't done it yet as I have
hit a big problem.

I will first outline the current situation.

apt-listbugs is involed by a dpkg hook, and knows what version of the
package it is installing. It then looks in the index files for the
appropriate severities, and finds all bugs that are open against the
package it is considering.

It should then look in the bug report files for the title etc. and
should now look at the versions that it affects, then decide which bugs
to show.

The problem is that the output of bts2ldap has no version number
information, it has fields like

  debbugsAffected: testing

and dpkg doesn't tell apt-listbugs what distribution a package is from
(or even know).

As I see it there are three options to deal with this.

 1. modify bts2ldap to give a list of versions affected, or at least a
    range of affected versions. I don't know if this is
    possible/easy/wanted.

 2. generate the version information when the index files are created on
    the server. This requires a full list about what versions of each 
    package are in each distribution. Up to date Packages.gz for each 
    distribution would do, but I don't know if they are available on
    merkel. There may be other ways to get this information on that
    machine that I don't know about.

 3. Do it at run time by doing something like parsing the output of
    apt-cache madison. Will be more up to date that the other methods
    probably (by hours I guess). However there are problems like you can
    have a system that only refers to etch, rather than testing, so you
    would need a mapping between them, but that can't be done as far as
    I can see. Maybe the mapping could be hosted with the index files,
    or the mapping done when they are generated.

So it seems to me like there are lots of problems with this. There are
also things to consider like skew between archive mirrors and the
apt-listbugs information. The user might be installing a version of the
package that apt-listbugs doesn't know about.

It seems like it is going to be very difficult to make apt-listbugs in
its current architecture work with the versioned bts. Maybe a new design
is needed.

It has been pointed out that as it is apt-listbugs is worse that
useless, so I think that unless someone has a good idea then
apt-listbugs should not ship with etch.

This would be a shame, hopefully a fix can be found. I have spent a
while thinking about it now, and I have been unable to come up with one
so far. I will keep thinking, butit would be good to get some help from
somewhere. Any volunteers should feel free to drop me a message to talk
about anything. Oh, and I still have a pacakage that fixes a lot of the
other bugs if anyone decides to adopt/qa upload/NMU. 

James

-- 
  James Westby   --    GPG Key ID: B577FE13    --     http://jameswestby.net/
  seccure key - (3+)k7|M*edCX/.A:n*N!>|&7U.L#9E)Tu)T0>AM - secp256r1/nistp256
#!/usr/bin/python
# This script creates index files for use with apt-listbugs.
# iIt currently opens a plain text file named 'full' that is the output 
# of bts2ldap, but I will add a different method to the front if requested.
#
# Copyright (C) 2006 James Westby <[EMAIL PROTECTED]>
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License with
#  the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL;
#  if not, write to the Free Software Foundation, Inc., 59 Temple Place,
#  Suite 330, Boston, MA  02111-1307  USA
#


from ldif import LDIFParser
import sys
from gzip import GzipFile
from apt import Cache

severities = ['wishlist', 'minor', 'normal', 'important', 'serious', 
'critical', 'grave']

class BugParser(LDIFParser):

  def __init__(self, file):
    LDIFParser.__init__(self, file)
    self._files = {}
    for severity in severities:
      fp = GzipFile("index.db-"+severity+"-new.gz", 'w')
      self._files[severity] = fp
    self._cache = Cache()

  def write_entry(self, severity, entry):
    self._files[severity].write(entry)

  def handle(self,dn,entry):
    bugline = entry['debbugsPackage'][0] + " "
    bugID = entry['debbugsID'][0]
    bugline += bugID + " "
    bugline += entry['debbugsDate'][0] +" "
    bugline += entry['debbugsState'][0] +" "
    try:
      submitter = entry['debbugsSubmitter'][0]
    except KeyError:
      submitter = ""
    bugline += "[" + submitter +"] "
    severity = entry['debbugsSeverity'][0]
    bugline += severity + " "
    try: 
      for tag in entry['debbugsTag']:
        bugline += tag + " "
    except KeyError:
      pass
    bugline += "\n"
    self.write_entry(severity, bugline)
    

f = open('full')
p = BugParser(f)
p.parse()

Attachment: signature.asc
Description: Digital signature

Reply via email to