On Sun, Mar 10, 2002 at 05:08:59PM +1000, Anthony Towns wrote: > Please keep looking through packages you maintain or use to make sure > they're releasable. It's easy enough for maintainers to look up bugs for the packages that they maintain. This script may be useful to those looking for bugs in packages that they use. It is a quick and dirty version of something that I was hoping to clean up before unleashing, but after seeing a couple of packages that I use get removed from woody, I think it might be worthwhile for others to play with now. It depends on popularity-contest and reportbug, and you must have run /etc/cron.weekly/popularity-contest recently in order for it to work correctly. -- - mdz
#!/usr/bin/python # # popbugs - Find bugs in commonly used packages # Copyright (C) 2001 Matt Zimmerman <mdz@debian.org> # # 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 along with this program; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # import sys import debianbts import re popconfile = '/var/log/popularity-contest' maxbugs = maxbugs_step = 1 if len(sys.argv) > 1: popconfile = sys.argv[1] packageatime = [] popcon = open(popconfile,'r') for line in popcon.readlines(): if len(line) == 0 or line.find(':') != -1: continue fields = line.split() if len(fields) != 4: continue if fields[0] == 'POPULARITY-CONTEST-0' or fields[0] == 'END-POPULARITY-CONTEST-0': continue (atime, ctime, package, pathname) = fields if pathname == '<NOFILES>' or pathname == '<RECENT-CTIME>': continue packageatime.append((package,atime)) popcon.close() categoryre = re.compile('(\S+) .* - (\S+)') packageatime.sort(lambda a,b: -cmp(a[1],b[1])) bugs_so_far = 0 for (package,atime) in packageatime: #print "%s..." % package (count, title, hierarchy) = debianbts.get_reports(package) if hierarchy == None: continue bugs = [] for (categorydesc,buglist) in hierarchy: if categorydesc == 'No reports found!': continue match = categoryre.match(categorydesc) if not match: sys.stderr.write("Warning: didn't understand: %s\n" % categorydesc) continue severity,status = match.groups() #print severity, status, `buglist` if not status in ('outstanding', 'forwarded to upstream software authors'): continue if severity == 'NMU': severity = 'fixed' numeric_severity = debianbts.SEVLIST.index(severity.lower()) if numeric_severity > 2: # Not release-critical continue bugs.append((numeric_severity,buglist)) if len(bugs) == 0: continue bugs.sort(lambda a,b: -cmp(a[0], b[0])) for (numeric_severity,buglist) in bugs: for bug in buglist: print '%s [%s]: %s' % (package, debianbts.SEVLIST[numeric_severity], bug) bugs_so_far += 1 if bugs_so_far >= maxbugs: print "Want to see more? [Y/n] ", answer = sys.stdin.readline() if len(answer) == 0 or answer[0].lower() == 'n': sys.exit(0) maxbugs += maxbugs_step
Attachment:
pgpDLMtsSp1D8.pgp
Description: PGP signature