From a54e78686e57a19a511672f0997b41a5380b4928 Mon Sep 17 00:00:00 2001 From: Pavla Kratochvilova Date: Sep 27 2019 06:06:07 +0000 Subject: Backport patch to fix traceback in system-upgrade (RhBug:1751103,1746346) --- diff --git a/0001-tests-Fix-expected-message-from-rpmconf.patch b/0001-tests-Fix-expected-message-from-rpmconf.patch new file mode 100644 index 0000000..ac95fcf --- /dev/null +++ b/0001-tests-Fix-expected-message-from-rpmconf.patch @@ -0,0 +1,27 @@ +From bbdc14311cafa70d67ab0d428af146a10cace48b Mon Sep 17 00:00:00 2001 +From: Pavla Kratochvilova +Date: Tue, 24 Sep 2019 13:45:28 +0200 +Subject: [PATCH] [tests] Fix expected message from rpmconf. + +The output of rpmconf changed with commit: +https://github.com/xsuchy/rpmconf/commit/b704842162cc03c1fd22e86bd8e0262344a7f5ba +--- + tests/test_rpmconf.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_rpmconf.py b/tests/test_rpmconf.py +index d6db397..a110a12 100644 +--- a/tests/test_rpmconf.py ++++ b/tests/test_rpmconf.py +@@ -182,7 +182,7 @@ class TestRpmConf(unittest.TestCase): + + lines = stdout.getvalue().splitlines() + +- expected_last_line = "File {0} was removed by 3rd party. Skipping.".format(new_path) ++ expected_last_line = "File {0} has been merged.".format(new_path) + self.assertEqual(lines[-1], expected_last_line) + + def test_diff_output(self): +-- +libgit2 0.28.2 + diff --git a/0002-system-upgrade-Check-not-None-before-setting-gpgcheck-options-RhBug17511031746346.patch b/0002-system-upgrade-Check-not-None-before-setting-gpgcheck-options-RhBug17511031746346.patch new file mode 100644 index 0000000..ffd67b9 --- /dev/null +++ b/0002-system-upgrade-Check-not-None-before-setting-gpgcheck-options-RhBug17511031746346.patch @@ -0,0 +1,37 @@ +From b69ed80868f34d105bc9ec90ddf949ea5d7bc1de Mon Sep 17 00:00:00 2001 +From: Pavla Kratochvilova +Date: Tue, 24 Sep 2019 08:44:48 +0200 +Subject: [PATCH] [system-upgrade] Check not None before setting gpgcheck options (RhBug:1751103,1746346) + +https://bugzilla.redhat.com/show_bug.cgi?id=1751103 +https://bugzilla.redhat.com/show_bug.cgi?id=1746346 +--- + plugins/system_upgrade.py | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/plugins/system_upgrade.py b/plugins/system_upgrade.py +index 825202f..9bf3974 100644 +--- a/plugins/system_upgrade.py ++++ b/plugins/system_upgrade.py +@@ -414,10 +414,14 @@ class SystemUpgradeCommand(dnf.cli.Command): + # use the saved value for --allowerasing, etc. + self.opts.distro_sync = self.state.distro_sync + self.cli.demands.allow_erasing = self.state.allow_erasing +- self.base.conf.gpgcheck = self.state.gpgcheck +- for repo in self.base.repos.values(): +- repo.gpgcheck = repo.id in self.state.gpgcheck_repos +- repo.repo_gpgcheck = repo.id in self.state.repo_gpgcheck_repos ++ if self.state.gpgcheck is not None: ++ self.base.conf.gpgcheck = self.state.gpgcheck ++ if self.state.gpgcheck_repos is not None: ++ for repo in self.base.repos.values(): ++ repo.gpgcheck = repo.id in self.state.gpgcheck_repos ++ if self.state.repo_gpgcheck_repos is not None: ++ for repo in self.base.repos.values(): ++ repo.repo_gpgcheck = repo.id in self.state.repo_gpgcheck_repos + self.base.conf.best = self.state.best + if self.state.exclude is None: + self.state.exclude = [] +-- +libgit2 0.28.2 + diff --git a/dnf-plugins-extras.spec b/dnf-plugins-extras.spec index 5af5674..1e77b88 100644 --- a/dnf-plugins-extras.spec +++ b/dnf-plugins-extras.spec @@ -15,11 +15,15 @@ Name: dnf-plugins-extras Version: 4.0.5 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Extras Plugins for DNF License: GPLv2+ URL: https://github.com/rpm-software-management/%{name} Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz +# Newer rpmconf changed output, so the tests need to be adjusted +Patch1: 0001-tests-Fix-expected-message-from-rpmconf.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1751103 +Patch2: 0002-system-upgrade-Check-not-None-before-setting-gpgcheck-options-RhBug17511031746346.patch BuildArch: noarch BuildRequires: cmake @@ -443,6 +447,9 @@ PYTHONPATH="%{buildroot}%{python3_sitelib}:%{buildroot}%{python3_sitelib}/dnf-pl %endif %changelog +* Fri Sep 27 2019 Pavla Kratochvilova - 4.0.5-3 +- Backport patch to fix traceback in system-upgrade (RhBug:1751103,1746346) + * Sun Aug 18 2019 Miro HronĨok - 4.0.5-2 - Rebuilt for Python 3.8