def get_installation_specs_packages_test(self): """Test the get_installation_specs function with packages.""" data = PackagesConfigurationData() data.packages = ["p1", "p2", "p3"] data.excluded_packages = ["p4", "p5", "p6"] self.assertEqual(get_installation_specs(data), ( ["@core", "p1", "p2", "p3"], ["p4", "p5", "p6"] ))
def _process_kickstart_packages(self, data): """Process the kickstart packages.""" packages = PackagesConfigurationData() packages.core_group_enabled = not data.packages.nocore packages.default_environment_enabled = data.packages.default if data.packages.environment is not None: packages.environment = data.packages.environment packages.packages = data.packages.packageList packages.excluded_packages = data.packages.excludedList for group in data.packages.groupList: packages.groups.append(group.name) if group.include == GROUP_ALL: packages.groups_package_types[ group.name] = GROUP_PACKAGE_TYPES_ALL if group.include == GROUP_REQUIRED: packages.groups_package_types[ group.name] = GROUP_PACKAGE_TYPES_REQUIRED for group in data.packages.excludedGroupList: packages.excluded_groups.append(group.name) packages.docs_excluded = data.packages.excludeDocs packages.weakdeps_excluded = data.packages.excludeWeakdeps if data.packages.handleMissing == KS_MISSING_IGNORE: packages.missing_ignored = True if data.packages.handleBroken == KS_BROKEN_IGNORE: packages.broken_ignored = True if data.packages.instLangs == "": packages.languages = RPM_LANGUAGES_NONE elif data.packages.instLangs is not None: packages.languages = data.packages.instLangs if data.packages.multiLib: packages.multilib_policy = MULTILIB_POLICY_ALL if data.packages.timeout is not None: packages.timeout = data.packages.timeout if data.packages.retries is not None: packages.retries = data.packages.retries self.set_packages(packages) self.set_packages_kickstarted(data.packages.seen)