X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Futils.py;h=542ede51c8cab50c9b56fd0b09c7e15f3b5daabc;hb=39cdc8cc1607dbacfcdbf8182e3a024c05737fe4;hp=c9b54d078db3bc6b85e05e214823eb8b54f2aa74;hpb=60fa4eed6dd87af458538142da39d41fafada6c8;p=dak.git diff --git a/daklib/utils.py b/daklib/utils.py index c9b54d07..542ede51 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -1536,3 +1536,32 @@ if not os.getenv("DAK_TEST"): if which_conf_file() != default_config: apt_pkg.ReadConfigFileISC(Cnf,which_conf_file()) + +################################################################################ + +def parse_wnpp_bug_file(file = "/srv/ftp-master.debian.org/scripts/masterfiles/wnpp_rm"): + """ + Parses the wnpp bug list available at http://qa.debian.org/data/bts/wnpp_rm + Well, actually it parsed a local copy, but let's document the source + somewhere ;) + + returns a dict associating source package name with a list of open wnpp + bugs (Yes, there might be more than one) + """ + lines = open(file).readlines() + wnpp = {} + + for line in lines: + splited_line = line.split(": ", 1) + if len(splited_line) > 1: + wnpp[splited_line[0]] = splited_line[1].split("|") + + for source in wnpp.keys(): + bugs = [] + for wnpp_bug in wnpp[source]: + bug_no = re.search("(\d)+", wnpp_bug).group() + if bug_no: + bugs.append(bug_no) + wnpp[source] = bugs + return wnpp +