3 from .util
import REPLACE_PACKAGES
7 ex_el = manifest.get_export_tag()
8 build_type_node = ex_el.getElementsByTagName(
'build_type')
12 built_type_tag = manifest.tree.createElement(
'build_type')
13 built_type_tag.appendChild(manifest.tree.createTextNode(build_type))
14 manifest.insert_new_tag_inside_another(ex_el, built_type_tag)
16 if build_type !=
'ament_cmake':
19 for build_tool
in manifest.root.getElementsByTagName(
'buildtool_depend'):
20 name = build_tool.childNodes[0].nodeValue
22 build_tool.childNodes[0] = manifest.tree.createTextNode(build_type)
26 manifest = package.manifest
27 if manifest.format < 2:
32 for export_tag
in manifest.tree.getElementsByTagName(
'export'):
33 for child
in export_tag.childNodes:
34 if child.nodeType == child.ELEMENT_NODE
and child.nodeName ==
'metapackage':
35 pairs.append((export_tag, child))
36 for parent, child
in pairs:
37 parent.removeChild(child)
38 manifest.changed =
True 41 for old_and_busted, new_hotness
in REPLACE_PACKAGES.items():
42 for tag_name
in DEPEND_ORDERING:
43 pkgs = package.manifest.get_packages_by_tag(tag_name)
44 if old_and_busted
in pkgs:
45 package.manifest.remove_dependencies(tag_name, [old_and_busted])
46 if new_hotness
not in pkgs:
47 package.manifest.insert_new_packages(tag_name, [new_hotness])