Blame SOURCES/0028-system-upgrade-Show-warning-always-for-a-downstream.patch

cbcd44
From dfbda502c5c46daf84e00179478de01e452f9dae Mon Sep 17 00:00:00 2001
cbcd44
From: Jan Kolarik <jkolarik@redhat.com>
cbcd44
Date: Fri, 16 Dec 2022 05:55:19 +0000
cbcd44
Subject: [PATCH] system-upgrade: Show warning always for a downstream
cbcd44
cbcd44
As the distro package is not available in the BaseOS, the warning implementation will be shown always, but only in related downstreams.
cbcd44
cbcd44
= changelog =
cbcd44
type: bugfix
cbcd44
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2152846
cbcd44
---
cbcd44
 dnf-plugins-core.spec     | 3 ++-
cbcd44
 plugins/system_upgrade.py | 6 ++----
cbcd44
 2 files changed, 4 insertions(+), 5 deletions(-)
cbcd44
cbcd44
diff --git a/dnf-plugins-core.spec b/dnf-plugins-core.spec
cbcd44
index a5ec165..0e1c9e3 100644
cbcd44
--- a/dnf-plugins-core.spec
cbcd44
+++ b/dnf-plugins-core.spec
cbcd44
@@ -148,13 +148,14 @@ Summary:    Core Plugins for DNF
cbcd44
 %{?python_provide:%python_provide python3-%{name}}
cbcd44
 BuildRequires:  python3-dbus
cbcd44
 BuildRequires:  python3-devel
cbcd44
-BuildRequires:  python3-distro
cbcd44
 BuildRequires:  python3-dnf >= %{dnf_lowest_compatible}
cbcd44
 BuildRequires:  python3-systemd
cbcd44
 BuildRequires:  pkgconfig(systemd)
cbcd44
 BuildRequires:  systemd
cbcd44
 %{?systemd_ordering}
cbcd44
+%if 0%{?fedora}
cbcd44
 Requires:       python3-distro
cbcd44
+%endif
cbcd44
 Requires:       python3-dbus
cbcd44
 Requires:       python3-dnf >= %{dnf_lowest_compatible}
cbcd44
 Requires:       python3-hawkey >= %{hawkey_version}
cbcd44
diff --git a/plugins/system_upgrade.py b/plugins/system_upgrade.py
cbcd44
index ef1de73..4f7620f 100644
cbcd44
--- a/plugins/system_upgrade.py
cbcd44
+++ b/plugins/system_upgrade.py
cbcd44
@@ -20,7 +20,6 @@
cbcd44
 """system_upgrade.py - DNF plugin to handle major-version system upgrades."""
cbcd44
 
cbcd44
 from subprocess import call, Popen, check_output, CalledProcessError
cbcd44
-import distro
cbcd44
 import json
cbcd44
 import os
cbcd44
 import os.path
cbcd44
@@ -452,9 +451,8 @@ class SystemUpgradeCommand(dnf.cli.Command):
cbcd44
 
cbcd44
     def configure_download(self):
cbcd44
         if 'system-upgrade' == self.opts.command or 'fedup' == self.opts.command:
cbcd44
-            if distro.id() == 'rhel':
cbcd44
-                logger.warning(_('WARNING: this operation is not supported on the RHEL distribution. '
cbcd44
-                                 'Proceed at your own risk.'))
cbcd44
+            logger.warning(_('WARNING: this operation is not supported on the RHEL distribution. '
cbcd44
+                             'Proceed at your own risk.'))
cbcd44
             help_url = get_url_from_os_release()
cbcd44
             if help_url:
cbcd44
                 msg = _('Additional information for System Upgrade: {}')
cbcd44
-- 
cbcd44
2.39.0
cbcd44