Exemple #1
0
    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)
    def set_rpm_macros_no_install_langs_test(self, mock_rpm):
        data = PackagesConfigurationData()
        data.languages = RPM_LANGUAGES_NONE

        macros = [
            ('__dbi_htconfig', 'hash nofsync %{__dbi_other} %{__dbi_perms}'),
            ('_install_langs', '%{nil}'),
        ]

        task = self._run_task(data)
        self._check_macros(task, mock_rpm, macros)
    def set_rpm_macros_install_langs_test(self, mock_rpm):
        data = PackagesConfigurationData()
        data.languages = "en,es"

        macros = [
            ('__dbi_htconfig', 'hash nofsync %{__dbi_other} %{__dbi_perms}'),
            ('_install_langs', 'en,es'),
        ]

        task = self._run_task(data)
        self._check_macros(task, mock_rpm, macros)