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>
(cherry picked from commit d3f0701e01
)
This commit is contained in:
parent
c402ff3d60
commit
72ddf65e62
@ -183,11 +183,12 @@ class CompsFilter(object):
|
||||
"""
|
||||
all_groups = self.tree.xpath("/comps/group/id/text()") + lookaside_groups
|
||||
for environment in self.tree.xpath("/comps/environment"):
|
||||
for group in environment.xpath("grouplist/groupid"):
|
||||
for parent_tag in ("grouplist", "optionlist"):
|
||||
for group in environment.xpath("%s/groupid" % parent_tag):
|
||||
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")
|
||||
values = [v for v in re.split(r"[, ]+", value) if v]
|
||||
if arch not in values:
|
||||
|
@ -108,6 +108,7 @@
|
||||
<groupid>core</groupid>
|
||||
</grouplist>
|
||||
<optionlist>
|
||||
<groupid arch="x86_64">standard</groupid>
|
||||
</optionlist>
|
||||
</environment>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user