From 00272eba3710921eb0ce908cce33f24b03a4568b Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Mon, 3 Nov 2014 11:04:08 +0000 Subject: [PATCH] Added support for compile:if-0install-version attribute This is useful if you want 0compile to see an element, but generate a plain "if-0install-version" attribute in the generated binary feed. --- build.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build.py b/build.py index 4c1d10d..6f15ee1 100644 --- a/build.py +++ b/build.py @@ -425,6 +425,16 @@ def find_feed_for(master_feed): return uri +# Convert compile:if-0install-version attributes to plain if-0install-version +def arm_if_0install_attrs(elem): + key = XMLNS_0COMPILE + ' if-0install-version' + old = elem.attrs.get(key, None) + if old: + del elem.attrs[key] + elem.attrs['if-0install-version'] = old + for child in elem.childNodes: + arm_if_0install_attrs(child) + def write_sample_feed(buildenv, master_feed, src_impl): path = buildenv.local_iface_file @@ -481,6 +491,8 @@ def write_sample_feed(buildenv, master_feed, src_impl): impl_elem = addSimple(group, 'implementation') impl_template = buildenv.get_binary_template() if impl_template: + arm_if_0install_attrs(impl_template) + # Copy attributes from template for fullname, value in impl_template.attrs.iteritems(): if fullname == 'arch': -- 2.11.4.GIT