X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Futils.py;h=542ede51c8cab50c9b56fd0b09c7e15f3b5daabc;hb=39cdc8cc1607dbacfcdbf8182e3a024c05737fe4;hp=5c7164705ee4147fe7f07c67d1adf0180e438cea;hpb=1d51baf77090bae1afb98016831a95c9b050ae2e;p=dak.git diff --git a/daklib/utils.py b/daklib/utils.py index 5c716470..542ede51 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -70,7 +70,9 @@ def dak_getstatusoutput(cmd): pipe = subprocess.Popen(cmd, shell=True, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - output, _ = pipe.communicate() + output = pipe.stdout.read() + + pipe.wait() if output[-1:] == '\n': output = output[:-1] @@ -1534,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 +