btargets = get_elem(dom, "buildtargets")
for btarget in btargets.getElementsByTagName("buildtarget"):
- bconf = get_elem(btarget, "buildconf")
-
target = {
"name": btarget.getAttribute("name"),
"archs": [],
"repos": [],
- "buildconf": {
- "location":
- get_elem(bconf, "location").getAttribute("href"),
- "checksum": {
- "type": get_elem(bconf, "checksum").getAttribute("type"),
- "value": get_elem(bconf, "checksum").firstChild.data
- }
}
- }
+
+ try:
+ bconf = get_elem(btarget, "buildconf")
+ target["buildconf"]={"location": get_elem(bconf, "location").getAttribute("href"),
+ "checksum": {"type": get_elem(bconf, "checksum").getAttribute("type"),
+ "value": get_elem(bconf, "checksum").firstChild.data}
+ }
+ except BuildDataError:
+ pass
+
# Get archs
for repo in btarget.getElementsByTagName("repo"):
barch = repo.getAttribute("arch")
target = self.targets[name]
content += '<buildtarget name="%s">' % name
- # buildconf
- content += '<buildconf>'
- buildconf = target['buildconf']
- content += '<location href="%s"/>' % buildconf['location']
- content += '<checksum type="%s">%s</checksum>' % \
- (buildconf['checksum']['type'],
- buildconf['checksum']['value'])
- content += '</buildconf>'
+ if 'buildconf' in self.targets.keys():
+ # buildconf
+ content += '<buildconf>'
+ buildconf = target['buildconf']
+ content += '<location href="%s"/>' % buildconf['location']
+ content += '<checksum type="%s">%s</checksum>' % \
+ (buildconf['checksum']['type'],
+ buildconf['checksum']['value'])
+ content += '</buildconf>'
# repos
for rtype, rarch, rpath in target["repos"]: