Update from upstream #11

Closed
soksanichenko wants to merge 158 commits from a8_updated into a8
Showing only changes of commit 9ea1098eae - Show all commits

View File

@ -325,9 +325,8 @@ class CompsWrapper(object):
group_node.appendChild(packagelist) group_node.appendChild(packagelist)
for category in self.comps.categories: for category in self.comps.categories:
groups = set(x.name for x in category.group_ids) & set( group_ids = set(self.get_comps_groups())
self.get_comps_groups() groups = set(g for g in category.group_ids if g.name in group_ids)
)
if not groups: if not groups:
continue continue
cat_node = doc.createElement("category") cat_node = doc.createElement("category")
@ -341,7 +340,7 @@ class CompsWrapper(object):
append_grouplist(doc, cat_node, groups) append_grouplist(doc, cat_node, groups)
for environment in sorted(self.comps.environments, key=attrgetter("id")): for environment in sorted(self.comps.environments, key=attrgetter("id")):
groups = set(x.name for x in environment.group_ids) groups = set(environment.group_ids)
if not groups: if not groups:
continue continue
env_node = doc.createElement("environment") env_node = doc.createElement("environment")
@ -356,10 +355,7 @@ class CompsWrapper(object):
if environment.option_ids: if environment.option_ids:
append_grouplist( append_grouplist(
doc, doc, env_node, set(environment.option_ids), "optionlist",
env_node,
(x.name for x in environment.option_ids),
"optionlist",
) )
if self.comps.langpacks: if self.comps.langpacks:
@ -460,8 +456,11 @@ def append(doc, parent, elem, content=None, lang=None, **kwargs):
def append_grouplist(doc, parent, groups, elem="grouplist"): def append_grouplist(doc, parent, groups, elem="grouplist"):
grouplist_node = doc.createElement(elem) grouplist_node = doc.createElement(elem)
for groupid in sorted(groups): for groupid in sorted(groups, key=lambda x: x.name):
append(doc, grouplist_node, "groupid", groupid) kwargs = {}
if groupid.default:
kwargs["default"] = "true"
append(doc, grouplist_node, "groupid", groupid.name, **kwargs)
parent.appendChild(grouplist_node) parent.appendChild(grouplist_node)