comps: Apply arch filtering to environment/optionlist
Let's filter this list too, not just the grouplist tag. JIRA: RHELCMP-7926 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
8f6f0f463f
commit
d3f0701e01
@ -183,15 +183,16 @@ class CompsFilter(object):
|
|||||||
"""
|
"""
|
||||||
all_groups = self.tree.xpath("/comps/group/id/text()") + lookaside_groups
|
all_groups = self.tree.xpath("/comps/group/id/text()") + lookaside_groups
|
||||||
for environment in self.tree.xpath("/comps/environment"):
|
for environment in self.tree.xpath("/comps/environment"):
|
||||||
for group in environment.xpath("grouplist/groupid"):
|
for parent_tag in ("grouplist", "optionlist"):
|
||||||
if group.text not in all_groups:
|
for group in environment.xpath("%s/groupid" % parent_tag):
|
||||||
group.getparent().remove(group)
|
if group.text not in all_groups:
|
||||||
|
group.getparent().remove(group)
|
||||||
|
|
||||||
for group in environment.xpath("grouplist/groupid[@arch]"):
|
for group in environment.xpath("%s/groupid[@arch]" % parent_tag):
|
||||||
value = group.attrib.get("arch")
|
value = group.attrib.get("arch")
|
||||||
values = [v for v in re.split(r"[, ]+", value) if v]
|
values = [v for v in re.split(r"[, ]+", value) if v]
|
||||||
if arch not in values:
|
if arch not in values:
|
||||||
group.getparent().remove(group)
|
group.getparent().remove(group)
|
||||||
|
|
||||||
def remove_empty_environments(self):
|
def remove_empty_environments(self):
|
||||||
"""
|
"""
|
||||||
|
@ -108,6 +108,7 @@
|
|||||||
<groupid>core</groupid>
|
<groupid>core</groupid>
|
||||||
</grouplist>
|
</grouplist>
|
||||||
<optionlist>
|
<optionlist>
|
||||||
|
<groupid arch="x86_64">standard</groupid>
|
||||||
</optionlist>
|
</optionlist>
|
||||||
</environment>
|
</environment>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user