| 126 |
patches[package]['ubuntu'] = (version, "http://patches.ubuntu.com/" + rel_url) |
patches[package]['ubuntu'] = (version, "http://patches.ubuntu.com/" + rel_url) |
| 127 |
f.close() |
f.close() |
| 128 |
|
|
| 129 |
|
# read low threshold NMU infos |
| 130 |
|
def read_low_threshold_nmu(fname): |
| 131 |
|
emails = [] |
| 132 |
|
if os.path.exists(fname): |
| 133 |
|
f = open(fname) |
| 134 |
|
devel_php_RE = \ |
| 135 |
|
re.compile(r'http://qa\.debian\.org/developer\.php\?login=([^\s&]+)') |
| 136 |
|
word_RE = re.compile(r'^\w+$') |
| 137 |
|
for line in f.readlines(): |
| 138 |
|
match = devel_php_RE.search(line) |
| 139 |
|
while match: # look for several matches on the same line |
| 140 |
|
email = None |
| 141 |
|
login = match.group(1) |
| 142 |
|
if word_RE.match(login): |
| 143 |
|
email = login + '@debian.org' |
| 144 |
|
elif login.find('@') >= 0: |
| 145 |
|
email = login |
| 146 |
|
if email: |
| 147 |
|
emails.append(email) |
| 148 |
|
line = line[match.end():] |
| 149 |
|
match = devel_php_RE.search(line) |
| 150 |
|
f.close() |
| 151 |
|
return emails |
| 152 |
|
|
| 153 |
|
# write lowThresholdNmu info to a (global, i.e. not per-package) file |
| 154 |
|
low_nmu_emails = read_low_threshold_nmu(dir + "/low_threshold_nmu.txt") |
| 155 |
|
f = open(odir + "/low_threshold_nmu.emails.xml", 'w') |
| 156 |
|
f.write("<emails>\n"); |
| 157 |
|
f.writelines(map(lambda s: " <email>%s</email>\n" % s, low_nmu_emails)) |
| 158 |
|
f.write("</emails>\n"); |
| 159 |
|
f.close() |
| 160 |
|
|
| 161 |
# Create the XML documents |
# Create the XML documents |
| 162 |
while 1: |
while 1: |
| 163 |
line = sys.stdin.readline() |
line = sys.stdin.readline() |