def __apply_selections(self, dbo): excludedPkgs = kickstart.get_excluded(self.ks, self._get_excluded_packages()) if kickstart.nocore(self.ks): logging.info("skipping core group due to %%packages --nocore; system may not be complete") else: try: dbo.selectGroup('core', excludedPkgs) logging.info("selected group: core") except dnf.exceptions.MarkingError as e: if kickstart.ignore_missing(self.ks): logging.warning("Skipping missing group 'core'") else: raise CreatorError("Failed to find group 'core' : %s" % (e,)) env = kickstart.get_environment(self.ks) excludedGroups = [group.name for group in kickstart.get_excluded_groups(self.ks)] if env: try: dbo.selectEnvironment(env, excludedGroups, excludedPkgs) logging.info("selected env: %s", env) except dnf.exceptions.MarkingError as e: if kickstart.ignore_missing(self.ks): logging.warning("Skipping missing environment '%s'" % (env,)) else: raise CreatorError("Failed to find environment '%s' : %s" % (env, e)) for group in kickstart.get_groups(self.ks): if group.name == 'core' or group.name in excludedGroups: continue try: dbo.selectGroup(group.name, excludedPkgs, group.include) logging.info("selected group: %s", group.name) except dnf.exceptions.MarkingError as e: if kickstart.ignore_missing(self.ks): logging.warning("Skipping missing group '%s'" % (group.name,)) else: raise CreatorError("Failed to find group '%s' : %s" % (group.name, e)) for pkg_name in set(excludedPkgs): dbo.deselectPackage(pkg_name) logging.info("excluding package: '%s'", pkg_name) for pkg_name in set(kickstart.get_packages(self.ks, self._get_required_packages())) - set(excludedPkgs): try: dbo.selectPackage(pkg_name) logging.info("selected package: '%s'", pkg_name) except dnf.exceptions.MarkingError as e: if kickstart.ignore_missing(self.ks): logging.warning("Skipping missing package '%s'" % (pkg_name,)) else: raise CreatorError("Failed to find package '%s' : %s" % (pkg_name, e))
def __deselect_packages(self, ayum): for pkg in kickstart.get_excluded(self.ks, self._get_excluded_packages()): ayum.deselectPackage(pkg)