Backport patches

Resolves: rhbz#2139326
Related: rhbz#2131288
This commit is contained in:
Nicola Sella 2022-12-07 14:15:23 +01:00
parent 4d1da482c6
commit 7dc0168e92
4 changed files with 1894 additions and 7 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,78 @@
From 307641a869134de4ebd496d1a78e5ff128a26293 Mon Sep 17 00:00:00 2001
From: Jan Kolarik <jkolarik@redhat.com>
Date: Fri, 30 Sep 2022 11:36:26 +0000
Subject: [PATCH 2/4] Add a warning when using `system-upgrade` on RHEL
---
dnf-plugins-core.spec | 3 +--
doc/system-upgrade.rst | 6 ++++--
plugins/system_upgrade.py | 4 ++++
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/dnf-plugins-core.spec b/dnf-plugins-core.spec
index 4df6e44..1ee87a1 100644
--- a/dnf-plugins-core.spec
+++ b/dnf-plugins-core.spec
@@ -148,14 +148,13 @@ Summary: Core Plugins for DNF
%{?python_provide:%python_provide python3-%{name}}
BuildRequires: python3-dbus
BuildRequires: python3-devel
+BuildRequires: python3-distro
BuildRequires: python3-dnf >= %{dnf_lowest_compatible}
BuildRequires: python3-systemd
BuildRequires: pkgconfig(systemd)
BuildRequires: systemd
%{?systemd_ordering}
-%if 0%{?fedora}
Requires: python3-distro
-%endif
Requires: python3-dbus
Requires: python3-dnf >= %{dnf_lowest_compatible}
Requires: python3-hawkey >= %{hawkey_version}
diff --git a/doc/system-upgrade.rst b/doc/system-upgrade.rst
index 3110460..87b7319 100644
--- a/doc/system-upgrade.rst
+++ b/doc/system-upgrade.rst
@@ -27,13 +27,15 @@ DNF system-upgrades plugin provides three commands: ``system-upgrade``, ``offlin
``offline-distrosync``. Only ``system-upgrade`` command requires increase of distribution major
version (``--releasever``) compared to installed version.
-``dnf system-upgrade`` can be used to upgrade a Fedora system to a new major
-release. It replaces fedup (the old Fedora Upgrade tool). Before you proceed ensure that your system
+``dnf system-upgrade`` is a recommended way to upgrade a system to a new major release.
+It replaces fedup (the old Fedora Upgrade tool). Before you proceed ensure that your system
is fully upgraded (``dnf --refresh upgrade``).
The ``system-upgrade`` command also performes additional actions necessary for the upgrade of the
system, for example an upgrade of groups and environments.
+.. WARNING:: The ``system-upgrade`` command is not supported on the RHEL distribution.
+
--------
Synopsis
--------
diff --git a/plugins/system_upgrade.py b/plugins/system_upgrade.py
index fee6762..0baf978 100644
--- a/plugins/system_upgrade.py
+++ b/plugins/system_upgrade.py
@@ -20,6 +20,7 @@
"""system_upgrade.py - DNF plugin to handle major-version system upgrades."""
from subprocess import call, Popen, check_output, CalledProcessError
+import distro
import json
import os
import os.path
@@ -451,6 +452,9 @@ class SystemUpgradeCommand(dnf.cli.Command):
def configure_download(self):
if 'system-upgrade' == self.opts.command or 'fedup' == self.opts.command:
+ if distro.id() == 'rhel':
+ logger.warning(_('WARNING: this operation is not supported on the RHEL distribution. '
+ 'Proceed at your own risk.'))
help_url = get_url_from_os_release()
if help_url:
msg = _('Additional information for System Upgrade: {}')
--
2.38.1

View File

@ -0,0 +1,61 @@
From eef927ac825c1a07082e10ffbf11e16ecbd7688c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tarc=C3=ADsio=20Ladeia=20de=20Oliveira?=
<wyrquill@gmail.com>
Date: Thu, 20 Oct 2022 22:16:59 -0300
Subject: [PATCH 1/2] [offline-upgrade] Add security filters (RhBug:1939975)
Add support for security filter options that are available in the main
`dnf` commands, that is, `--advisory`, `--bugfix`, `--security`, and
`--enhancement`.
= changelog =
msg: [offline-upgrade] Add support for security filters
type: bugfix
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1939975
---
plugins/system_upgrade.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/plugins/system_upgrade.py b/plugins/system_upgrade.py
index 0baf978..ef1de73 100644
--- a/plugins/system_upgrade.py
+++ b/plugins/system_upgrade.py
@@ -467,6 +467,9 @@ class SystemUpgradeCommand(dnf.cli.Command):
logger.error(_("Operation aborted."))
sys.exit(1)
check_release_ver(self.base.conf, target=self.opts.releasever)
+ elif 'offline-upgrade' == self.opts.command:
+ self.cli._populate_update_security_filter(self.opts)
+
self.cli.demands.root_user = True
self.cli.demands.resolving = True
self.cli.demands.available_repos = True
--
2.38.1
From 7e5d3028caa743f3e5ac7bf921c3ec39a4d2c85b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tarc=C3=ADsio=20Ladeia=20de=20Oliveira?=
<wyrquill@gmail.com>
Date: Thu, 20 Oct 2022 22:27:22 -0300
Subject: [PATCH 2/2] Add myself as contributor in AUTHORS
---
AUTHORS | 1 +
1 file changed, 1 insertion(+)
diff --git a/AUTHORS b/AUTHORS
index 352e195..f098cb6 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -32,6 +32,7 @@ DNF-PLUGINS-CORE CONTRIBUTORS
Neal Gompa <ngompa13@gmail.com>
Paul Howarth <paul@city-fan.org>
Rickard Dybeck <r.dybeck@gmail.com>
+ Tarcísio Ladeia de Oliveira <wyrquill@gmail.com>
Tomas Babej <tomasbabej@gmail.com>
Vladan Kudlac <vladankudlac@gmail.com>
Wieland Hoffmann <themineo@gmail.com>
--
2.38.1

View File

@ -34,11 +34,15 @@
Name: dnf-plugins-core
Version: 4.3.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Core Plugins for DNF
License: GPLv2+
URL: https://github.com/rpm-software-management/dnf-plugins-core
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Patch1: 0001-Move-system-upgrade-plugin-to-core-RhBug-2054235.patch
Patch2: 0002-Add-a-warning-when-using-system-upgrade-on-RHEL.patch
Patch3: 0003-offline-upgrade-Add-security-filters.patch
BuildArch: noarch
BuildRequires: cmake
@ -65,6 +69,9 @@ Provides: dnf-command(repograph)
Provides: dnf-command(repomanage)
Provides: dnf-command(reposync)
Provides: dnf-command(repodiff)
Provides: dnf-command(system-upgrade)
Provides: dnf-command(offline-upgrade)
Provides: dnf-command(offline-distrosync)
Provides: dnf-plugins-extras-debug = %{version}-%{release}
Provides: dnf-plugins-extras-repoclosure = %{version}-%{release}
Provides: dnf-plugins-extras-repograph = %{version}-%{release}
@ -81,6 +88,7 @@ Provides: dnf-plugin-repodiff = %{version}-%{release}
Provides: dnf-plugin-repograph = %{version}-%{release}
Provides: dnf-plugin-repomanage = %{version}-%{release}
Provides: dnf-plugin-reposync = %{version}-%{release}
Provides: dnf-plugin-system-upgrade = %{version}-%{release}
%if %{with yumcompatibility}
Provides: yum-plugin-copr = %{version}-%{release}
Provides: yum-plugin-changelog = %{version}-%{release}
@ -134,8 +142,8 @@ Conflicts: python-%{name} < %{version}-%{release}
%description -n python2-%{name}
Core Plugins for DNF, Python 2 interface. This package enhances DNF with builddep,
config-manager, copr, degug, debuginfo-install, download, needs-restarting,
groups-manager, repoclosure, repograph, repomanage, reposync, changelog
and repodiff commands.
groups-manager, repoclosure, repograph, repomanage, reposync, changelog,
repodiff, system-upgrade, offline-upgrade and offline-distrosync commands.
Additionally provides generate_completion_cache passive plugin.
%endif
@ -145,22 +153,28 @@ Summary: Core Plugins for DNF
%{?python_provide:%python_provide python3-%{name}}
BuildRequires: python3-dbus
BuildRequires: python3-devel
BuildRequires: python3-distro
BuildRequires: python3-dnf >= %{dnf_lowest_compatible}
%if 0%{?fedora}
BuildRequires: python3-systemd
BuildRequires: pkgconfig(systemd)
BuildRequires: systemd
%{?systemd_ordering}
Requires: python3-distro
%endif
Requires: python3-dbus
Requires: python3-dnf >= %{dnf_lowest_compatible}
Requires: python3-hawkey >= %{hawkey_version}
Requires: python3-dateutil
Requires: python3-systemd
Provides: python3-dnf-plugins-extras-debug = %{version}-%{release}
Provides: python3-dnf-plugins-extras-repoclosure = %{version}-%{release}
Provides: python3-dnf-plugins-extras-repograph = %{version}-%{release}
Provides: python3-dnf-plugins-extras-repomanage = %{version}-%{release}
Provides: python3-dnf-plugin-system-upgrade = %{version}-%{release}
Obsoletes: python3-dnf-plugins-extras-debug < %{dnf_plugins_extra}
Obsoletes: python3-dnf-plugins-extras-repoclosure < %{dnf_plugins_extra}
Obsoletes: python3-dnf-plugins-extras-repograph < %{dnf_plugins_extra}
Obsoletes: python3-dnf-plugins-extras-repomanage < %{dnf_plugins_extra}
Obsoletes: python3-dnf-plugin-system-upgrade < %{version}-%{release}
Conflicts: %{name} <= 0.1.5
# let the both python plugin versions be updated simultaneously
@ -170,8 +184,8 @@ Conflicts: python-%{name} < %{version}-%{release}
%description -n python3-%{name}
Core Plugins for DNF, Python 3 interface. This package enhances DNF with builddep,
config-manager, copr, debug, debuginfo-install, download, needs-restarting,
groups-manager, repoclosure, repograph, repomanage, reposync, changelog
and repodiff commands.
groups-manager, repoclosure, repograph, repomanage, reposync, changelog,
repodiff, system-upgrade, offline-upgrade and offline-distrosync commands.
Additionally provides generate_completion_cache passive plugin.
%endif
@ -452,6 +466,17 @@ pushd build-py3
%make_install
popd
%endif
%if %{with python3}
mkdir -p %{buildroot}%{_unitdir}/system-update.target.wants/
pushd %{buildroot}%{_unitdir}/system-update.target.wants/
ln -sr ../dnf-system-upgrade.service
popd
ln -sf %{_mandir}/man8/dnf-system-upgrade.8.gz %{buildroot}%{_mandir}/man8/dnf-offline-upgrade.8.gz
ln -sf %{_mandir}/man8/dnf-system-upgrade.8.gz %{buildroot}%{_mandir}/man8/dnf-offline-distrosync.8.gz
%endif
%find_lang %{name}
%if %{with yumutils}
%if %{with python3}
@ -516,6 +541,9 @@ ln -sf %{_mandir}/man1/%{yum_utils_subpackage_name}.1.gz %{buildroot}%{_mandir}/
%{_mandir}/man8/dnf-repograph.*
%{_mandir}/man8/dnf-repomanage.*
%{_mandir}/man8/dnf-reposync.*
%{_mandir}/man8/dnf-system-upgrade.*
%{_mandir}/man8/dnf-offline-upgrade.*
%{_mandir}/man8/dnf-offline-distrosync.*
%if %{with yumcompatibility}
%{_mandir}/man1/yum-changelog.*
%{_mandir}/man8/yum-copr.*
@ -573,6 +601,7 @@ ln -sf %{_mandir}/man1/%{yum_utils_subpackage_name}.1.gz %{buildroot}%{_mandir}/
%{python3_sitelib}/dnf-plugins/repograph.py
%{python3_sitelib}/dnf-plugins/repomanage.py
%{python3_sitelib}/dnf-plugins/reposync.py
%{python3_sitelib}/dnf-plugins/system_upgrade.py
%{python3_sitelib}/dnf-plugins/__pycache__/builddep.*
%{python3_sitelib}/dnf-plugins/__pycache__/changelog.*
%{python3_sitelib}/dnf-plugins/__pycache__/config_manager.*
@ -588,7 +617,11 @@ ln -sf %{_mandir}/man1/%{yum_utils_subpackage_name}.1.gz %{buildroot}%{_mandir}/
%{python3_sitelib}/dnf-plugins/__pycache__/repograph.*
%{python3_sitelib}/dnf-plugins/__pycache__/repomanage.*
%{python3_sitelib}/dnf-plugins/__pycache__/reposync.*
%{python3_sitelib}/dnf-plugins/__pycache__/system_upgrade.*
%{python3_sitelib}/dnfpluginscore/
%{_unitdir}/dnf-system-upgrade.service
%{_unitdir}/dnf-system-upgrade-cleanup.service
%{_unitdir}/system-update.target.wants/dnf-system-upgrade.service
%endif
%if %{with yumutils}
@ -784,6 +817,10 @@ ln -sf %{_mandir}/man1/%{yum_utils_subpackage_name}.1.gz %{buildroot}%{_mandir}/
%endif
%changelog
* Wed Dec 03 2022 Nicola Sella <nsella@redhat.com> - 4.3.0-2
- Move system-upgrade plugin to core (RhBug:2054235)
- offline-upgrade: add support for security filters (RhBug:1939975)
* Thu Sep 22 2022 Lukas Hrazky <lhrazky@redhat.com> - 4.3.0-1
- Update to 4.3.0
- [config-manager] Update documentation (RhBug:2075366)