From b8d85e764d5063b7960659a9c778d517a175a97e Mon Sep 17 00:00:00 2001 From: Radek Vykydal Date: May 25 2020 13:54:38 +0000 Subject: Remove support for --ignorebroken %packages option Reverts: https://github.com/rhinstaller/anaconda/pull/2189 Tests are not reverted. --- diff --git a/data/anaconda.conf b/data/anaconda.conf index 89731f4..32162f6 100644 --- a/data/anaconda.conf +++ b/data/anaconda.conf @@ -79,9 +79,6 @@ enabled_repositories_from_treeinfo = addon optional variant # Enable installation from the closest mirror. enable_closest_mirror = True -# Enable possibility to skip packages with conflicts and broken dependencies. -enable_ignore_broken_packages = True - # Check if payload supports the locales. check_supported_locales = False diff --git a/data/product.d/rhel.conf b/data/product.d/rhel.conf index a22fe79..034d6b4 100644 --- a/data/product.d/rhel.conf +++ b/data/product.d/rhel.conf @@ -36,12 +36,6 @@ ignored_packages = enable_updates = False enable_closest_mirror = False -# This feature may result in an installed system which won't have everything installed -# as expected. Because of this problem this feature will be disabled on RHEL based variants. -# When disabled the installation won't be started with --ignorebroken, instead it will inform user -# that the feature is not supported on their product. This will also block usage of related DBus API. -enable_ignore_broken_packages = False - [Bootloader] efi_dir = redhat diff --git a/pyanaconda/core/configuration/payload.py b/pyanaconda/core/configuration/payload.py index dd7ee13..edbc838 100644 --- a/pyanaconda/core/configuration/payload.py +++ b/pyanaconda/core/configuration/payload.py @@ -72,19 +72,6 @@ class PayloadSection(Section): return self._get_option("enable_closest_mirror", bool) @property - def enable_ignore_broken_packages(self): - """Enable possibility to skip packages with conflicts and broken dependencies. - - This enables --ignorebroken parameter of the packages section and related DBus API. - - If this feature is disabled Anaconda won't start the installation when - --ignorebroken paramater is used. Instead print error message to user - when Anaconda is started and quit the installation process. - It will also block use of related DBus API. - """ - return self._get_option("enable_ignore_broken_packages", bool) - - @property def check_supported_locales(self): """Check if payload supports the locales. diff --git a/pyanaconda/modules/payloads/kickstart.py b/pyanaconda/modules/payloads/kickstart.py index 0d2a877..23944b2 100644 --- a/pyanaconda/modules/payloads/kickstart.py +++ b/pyanaconda/modules/payloads/kickstart.py @@ -17,32 +17,9 @@ # License and may only be used or replicated with the express permission of # Red Hat, Inc. # -from pykickstart.errors import KickstartParseError -from pykickstart.sections import PackageSection -from pykickstart.constants import KS_BROKEN_IGNORE - -from pyanaconda.core.configuration.anaconda import conf -from pyanaconda.core.i18n import _ from pyanaconda.core.kickstart import KickstartSpecification, commands as COMMANDS -class AnacondaPackageSection(PackageSection): - - def handleHeader(self, lineno, args): - """Process packages section header. - - Add checks based on configuration settings. - """ - super().handleHeader(lineno, args) - - if not conf.payload.enable_ignore_broken_packages \ - and self.handler.packages.handleBroken == KS_BROKEN_IGNORE: - raise KickstartParseError( - _("The %packages --ignorebroken feature is not supported on your product!"), - lineno=lineno - ) - - class PayloadKickstartSpecification(KickstartSpecification): commands = { diff --git a/pyanaconda/modules/payloads/packages/packages.py b/pyanaconda/modules/payloads/packages/packages.py index b886170..556dd72 100644 --- a/pyanaconda/modules/payloads/packages/packages.py +++ b/pyanaconda/modules/payloads/packages/packages.py @@ -27,8 +27,7 @@ from pyanaconda.modules.payloads.packages.constants import MultilibPolicy, TIMEO RETRIES_UNSET, LANGUAGES_DEFAULT, LANGUAGES_NONE from pyanaconda.modules.payloads.packages.packages_interface import PackagesInterface -from pykickstart.constants import KS_MISSING_IGNORE, KS_MISSING_PROMPT, GROUP_DEFAULT, \ - KS_BROKEN_IGNORE, KS_BROKEN_REPORT +from pykickstart.constants import KS_MISSING_IGNORE, KS_MISSING_PROMPT, GROUP_DEFAULT from pykickstart.parser import Group from pyanaconda.anaconda_loggers import get_module_logger @@ -105,11 +104,6 @@ class PackagesModule(KickstartBaseModule): else: self.set_missing_ignored(False) - if packages.handleBroken == KS_BROKEN_IGNORE: - self.set_broken_ignored(True) - else: - self.set_broken_ignored(False) - if packages.instLangs is None: self.set_languages(LANGUAGES_DEFAULT) elif packages.instLangs == "": @@ -142,7 +136,6 @@ class PackagesModule(KickstartBaseModule): packages.excludeDocs = self.docs_excluded packages.excludeWeakdeps = self.weakdeps_excluded packages.handleMissing = KS_MISSING_IGNORE if self.missing_ignored else KS_MISSING_PROMPT - packages.handleBroken = KS_BROKEN_IGNORE if self.broken_ignored else KS_BROKEN_REPORT if self.languages == LANGUAGES_DEFAULT: packages.instLangs = None @@ -368,30 +361,6 @@ class PackagesModule(KickstartBaseModule): log.debug("Ignore missing is set to %s.", missing_ignored) @property - def broken_ignored(self): - """Ignore packages that have conflicts with other packages. - - :rtype: bool - """ - return self._broken_ignored - - def set_broken_ignored(self, broken_ignored): - """Set if the packages that have conflicts with other packages should be ignored. - - :param broken_ignored: True if broken packages should be ignored. - :type broken_ignored: bool - :raise: UnsupportedValueError if ignorebroken is disabled on this product. - """ - if not conf.payload.enable_ignore_broken_packages: - raise UnsupportedValueError( - "The ignore broken packages feature is not supported on this product" - ) - - self._broken_ignored = broken_ignored - self.broken_ignored_changed.emit() - log.debug("Ignore broken is set to %s.", broken_ignored) - - @property def languages(self): """Languages marked for installation. diff --git a/pyanaconda/modules/payloads/packages/packages_interface.py b/pyanaconda/modules/payloads/packages/packages_interface.py index 4820c16..f94a335 100644 --- a/pyanaconda/modules/payloads/packages/packages_interface.py +++ b/pyanaconda/modules/payloads/packages/packages_interface.py @@ -41,7 +41,6 @@ class PackagesInterface(KickstartModuleInterfaceTemplate): self.watch_property("DocsExcluded", self.implementation.docs_excluded_changed) self.watch_property("WeakdepsExcluded", self.implementation.weakdeps_excluded_changed) self.watch_property("MissingIgnored", self.implementation.missing_ignored_changed) - self.watch_property("BrokenIgnored", self.implementation.broken_ignored_changed) self.watch_property("Languages", self.implementation.languages_changed) self.watch_property("MultilibPolicy", self.implementation.multilib_policy_changed) self.watch_property("Timeout", self.implementation.timeout_changed) @@ -153,19 +152,6 @@ class PackagesInterface(KickstartModuleInterfaceTemplate): self.implementation.set_missing_ignored(missing_ignored) @property - def BrokenIgnored(self) -> Bool: - """Should the broken packages be ignored?""" - return self.implementation.broken_ignored - - @emits_properties_changed - def SetBrokenIgnored(self, broken_ignored: Bool): - """Set if the broken packages should be ignored. - - :raise: UnsupportedValueError if this feature is not supported on this product. - """ - self.implementation.set_broken_ignored(broken_ignored) - - @property def Languages(self) -> Str: """Languages marked for installation. diff --git a/pyanaconda/payload/dnf/payload.py b/pyanaconda/payload/dnf/payload.py index 3f0cbc8..52c04a3 100644 --- a/pyanaconda/payload/dnf/payload.py +++ b/pyanaconda/payload/dnf/payload.py @@ -43,8 +43,7 @@ from glob import glob from pyanaconda.modules.common.structures.payload import RepoConfigurationData from pyanaconda.payload.source import SourceFactory, PayloadSourceTypeUnrecognized -from pykickstart.constants import GROUP_ALL, GROUP_DEFAULT, KS_MISSING_IGNORE, KS_BROKEN_IGNORE, \ - GROUP_REQUIRED +from pykickstart.constants import GROUP_ALL, GROUP_DEFAULT, KS_MISSING_IGNORE, GROUP_REQUIRED from pykickstart.parser import Group from pyanaconda import errors as errors @@ -526,10 +525,8 @@ class DNFPayload(Payload): # feed it to DNF try: - # FIXME: Remove self._base.conf.strict workaround when bz1761518 is fixed # install_specs() returns a list of specs that appear to be missing - self._base.install_specs(install=include_list, exclude=exclude_list, - strict=self._base.conf.strict) + self._base.install_specs(install=include_list, exclude=exclude_list) except dnf.exceptions.MarkingErrors as e: log.debug("install_specs(): some packages, groups or modules " " are missing or broken:\n%s", e) @@ -672,15 +669,6 @@ class DNFPayload(Payload): if self.data.packages.retries is not None: config.retries = self.data.packages.retries - if self.data.packages.handleBroken == KS_BROKEN_IGNORE: - log.warning( - "\n*********************************************************************\n" - "User has requested to skip broken packages. Using this option may result " - "in an UNUSABLE system!\n" - "*********************************************************************" - ) - config.strict = False - self._configure_proxy() # Start with an empty comps so we can go ahead and use the environment