diff --git a/dnf/comps.py b/dnf/comps.py index 19df04dc0a..dbb0ad80fe 100644 --- a/dnf/comps.py +++ b/dnf/comps.py @@ -673,8 +673,9 @@ def _group_install(self, group_id, pkg_types, exclude=None, strict=True, exclude raise CompsError(_("Group id '%s' does not exist.") % ucd(group_id)) swdb_group = self.history.group.new(group_id, comps_group.name, comps_group.ui_name, pkg_types) - for i in comps_group.packages_iter(): - swdb_group.addPackage(i.name, False, Package._OPT_MAP[i.type]) + for pkg in comps_group.packages_iter(): + pkg_installed = self.history.swdb.getPackageCompsGroups(pkg.name) != () + swdb_group.addPackage(pkg.name, pkg_installed, Package._OPT_MAP[pkg.type]) self.history.group.install(swdb_group) trans = TransactionBunch() @@ -712,8 +713,9 @@ def _group_upgrade(self, group_id): # create a new record for current transaction swdb_group = self.history.group.new(group_id, comps_group.name, comps_group.ui_name, pkg_types) - for i in comps_group.packages_iter(): - swdb_group.addPackage(i.name, False, Package._OPT_MAP[i.type]) + for pkg in comps_group.packages_iter(): + pkg_installed = self.history.swdb.getPackageCompsGroups(pkg.name) != () + swdb_group.addPackage(pkg.name, pkg_installed, Package._OPT_MAP[pkg.type]) self.history.group.upgrade(swdb_group) trans = TransactionBunch()