| 1 |
#!/usr/bin/python |
#!/usr/bin/python |
| 2 |
# -*- coding: utf8 -*- |
# -*- coding: utf-8 -*- |
| 3 |
|
|
| 4 |
# vim: expandtab |
# vim: expandtab |
| 5 |
|
|
| 11 |
from xml.dom import implementation, ext |
from xml.dom import implementation, ext |
| 12 |
|
|
| 13 |
from config import dir, odir |
from config import dir, odir |
| 14 |
from common import vcs_table |
from common import vcs_table, hash_name |
| 15 |
|
|
| 16 |
# address_from_string takes an address in RFC822 format |
# address_from_string takes an address in RFC822 format |
| 17 |
# and turns it into a tuple of the form (real name, email). |
# and turns it into a tuple of the form (real name, email). |
| 52 |
"""Update the XML information with the given Message (Package entry)""" |
"""Update the XML information with the given Message (Package entry)""" |
| 53 |
global odir, old_done, new_done, new_dist_map |
global odir, old_done, new_done, new_dist_map |
| 54 |
package = m["Package"] |
package = m["Package"] |
| 55 |
hash = package[0] |
hash = hash_name(package) |
|
if package[0:3] == "lib": |
|
|
hash = package[0:4] |
|
| 56 |
# Check if the work has already been done |
# Check if the work has already been done |
| 57 |
key = "%s_%s_%s" % (m["Package"], m["Version"], dist) |
key = "%s_%s_%s" % (m["Package"], m["Version"], dist) |
| 58 |
new_done[key] = 1 |
new_done[key] = 1 |
| 75 |
child = doc.createElement(tag) |
child = doc.createElement(tag) |
| 76 |
root.appendChild(child) |
root.appendChild(child) |
| 77 |
if tag == "binary" or tag[0:5] == "build": |
if tag == "binary" or tag[0:5] == "build": |
| 78 |
for item in re.split(", ?", m[tag]): |
for item in re.split(",[ \n]*", m[tag]): |
| 79 |
# Take care of non-ascii, prevents troubles... |
# Take care of non-ascii, prevents troubles... |
| 80 |
text = doc.createTextNode(unicode(item,'ISO-8859-1','replace')) |
text = doc.createTextNode(unicode(item,'ISO-8859-1','replace')) |
| 81 |
item_elt = doc.createElement("item") |
item_elt = doc.createElement("item") |
| 178 |
for key in old_done.keys(): |
for key in old_done.keys(): |
| 179 |
(p, v, d) = key.split("_", 2) |
(p, v, d) = key.split("_", 2) |
| 180 |
if not new_dist_map.has_key("%s_%s" % (p, d)): |
if not new_dist_map.has_key("%s_%s" % (p, d)): |
| 181 |
hash = p[0] |
hash = hash_name(p) |
|
if p[0:3] == "lib": |
|
|
hash = p[0:4] |
|
| 182 |
filename = "%s/%s/%s/%s.xml" % (odir, hash, p, d) |
filename = "%s/%s/%s/%s.xml" % (odir, hash, p, d) |
| 183 |
filenamerebuild = "%s/%s/%s/force-rebuild" % (odir, hash, p) |
filenamerebuild = "%s/%s/%s/force-rebuild" % (odir, hash, p) |
| 184 |
if os.path.exists(filename): |
if os.path.exists(filename): |