From 3c1afff27475f6f2aa32e6f4659be16d47ed3fbf Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 26 Jun 2018 13:50:59 -0700 Subject: [PATCH] Initial DNF 3 compatibility via downstream patches --- ...bstitutions-moved-from-dnf-to-libdnf.patch | 37 +++++++++++ ...e-calculations-for-transaction-item-.patch | 43 +++++++++++++ ...allback-constants-moved-to-dnf.trans.patch | 62 +++++++++++++++++++ anaconda.spec | 14 ++++- 4 files changed, 154 insertions(+), 2 deletions(-) create mode 100644 0001-DNF-3-config-substitutions-moved-from-dnf-to-libdnf.patch create mode 100644 0002-DNF-3-Update-size-calculations-for-transaction-item-.patch create mode 100644 0003-DNF-3-progress-callback-constants-moved-to-dnf.trans.patch diff --git a/0001-DNF-3-config-substitutions-moved-from-dnf-to-libdnf.patch b/0001-DNF-3-config-substitutions-moved-from-dnf-to-libdnf.patch new file mode 100644 index 0000000..3917054 --- /dev/null +++ b/0001-DNF-3-config-substitutions-moved-from-dnf-to-libdnf.patch @@ -0,0 +1,37 @@ +From 73e1d130538ea4cdca2dfd6a273cb3f9ac092934 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Tue, 26 Jun 2018 11:53:22 -0700 +Subject: [PATCH 1/3] DNF 3: config substitutions moved from dnf to libdnf + +This just moved from dnf.conf to libdnf.conf, no big problem. + +Signed-off-by: Adam Williamson +--- + pyanaconda/payload/dnfpayload.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pyanaconda/payload/dnfpayload.py b/pyanaconda/payload/dnfpayload.py +index dee3903eb..8b8be68c9 100644 +--- a/pyanaconda/payload/dnfpayload.py ++++ b/pyanaconda/payload/dnfpayload.py +@@ -54,7 +54,7 @@ import dnf.logging + import dnf.exceptions + import dnf.repo + import dnf.callback +-import dnf.conf.parser ++import libdnf.conf + import dnf.conf.substitutions + import rpm + import librepo +@@ -325,7 +325,7 @@ class DNFPayload(payload.PackagePayload): + Currently supports $releasever and $basearch. + """ + if url: +- return dnf.conf.parser.substitute(url, self._base.conf.substitutions) ++ return libdnf.conf.ConfigParser.substitute(url, self._base.conf.substitutions) + + return None + +-- +2.18.0.rc2 + diff --git a/0002-DNF-3-Update-size-calculations-for-transaction-item-.patch b/0002-DNF-3-Update-size-calculations-for-transaction-item-.patch new file mode 100644 index 0000000..c5ea523 --- /dev/null +++ b/0002-DNF-3-Update-size-calculations-for-transaction-item-.patch @@ -0,0 +1,43 @@ +From f8ad90a0d76741b14767e1e94c9fbe6d760e301d Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Tue, 26 Jun 2018 12:14:56 -0700 +Subject: [PATCH 2/3] DNF 3: Update size calculations for transaction item + changes + +Seems we can basically get sizes for the package that backs a +transaction item now, rather than for the 'set of files it +installs'. + +Signed-off-by: Adam Williamson +--- + pyanaconda/payload/dnfpayload.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/pyanaconda/payload/dnfpayload.py b/pyanaconda/payload/dnfpayload.py +index 8b8be68c9..27bc6d7d3 100644 +--- a/pyanaconda/payload/dnfpayload.py ++++ b/pyanaconda/payload/dnfpayload.py +@@ -602,7 +602,7 @@ class DNFPayload(payload.PackagePayload): + if transaction is None: + return Size(0) + +- size = sum(tsi.installed.downloadsize for tsi in transaction) ++ size = sum(tsi.pkg.downloadsize for tsi in transaction) + # reserve extra + return Size(size) + Size("150 MB") + +@@ -782,9 +782,9 @@ class DNFPayload(payload.PackagePayload): + files_nm = 0 + for tsi in transaction: + # space taken by all files installed by the packages +- size += tsi.installed.installsize ++ size += tsi.pkg.installsize + # number of files installed on the system +- files_nm += len(tsi.installed.files) ++ files_nm += len(tsi.pkg.files) + + # append bonus size depending on number of files + bonus_size = files_nm * BONUS_SIZE_ON_FILE +-- +2.18.0.rc2 + diff --git a/0003-DNF-3-progress-callback-constants-moved-to-dnf.trans.patch b/0003-DNF-3-progress-callback-constants-moved-to-dnf.trans.patch new file mode 100644 index 0000000..351c940 --- /dev/null +++ b/0003-DNF-3-progress-callback-constants-moved-to-dnf.trans.patch @@ -0,0 +1,62 @@ +From 83ca305baf8aa1b08ab7e2b64845d94c820bfa1a Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Tue, 26 Jun 2018 12:43:15 -0700 +Subject: [PATCH 3/3] DNF 3: progress callback constants moved to + dnf.transaction + +Another fairly trivial DNF 3 fix. + +Signed-off-by: Adam Williamson +--- + pyanaconda/payload/dnfpayload.py | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/pyanaconda/payload/dnfpayload.py b/pyanaconda/payload/dnfpayload.py +index 27bc6d7d3..46a327f5a 100644 +--- a/pyanaconda/payload/dnfpayload.py ++++ b/pyanaconda/payload/dnfpayload.py +@@ -54,6 +54,7 @@ import dnf.logging + import dnf.exceptions + import dnf.repo + import dnf.callback ++import dnf.transaction + import libdnf.conf + import dnf.conf.substitutions + import rpm +@@ -176,7 +177,7 @@ class PayloadRPMDisplay(dnf.callback.TransactionProgress): + # Process DNF actions, communicating with anaconda via the queue + # A normal installation consists of 'install' messages followed by + # the 'post' message. +- if action == self.PKG_INSTALL and ti_done == 0: ++ if action == dnf.transaction.PKG_INSTALL and ti_done == 0: + # do not report same package twice + if self._last_ts == ts_done: + return +@@ -192,13 +193,13 @@ class PayloadRPMDisplay(dnf.callback.TransactionProgress): + log_msg = "Installed: %s %s %s" % (nevra, package.buildtime, package.returnIdSum()[1]) + self._queue.put(('log', log_msg)) + +- elif action == self.TRANS_POST: ++ elif action == dnf.transaction.TRANS_POST: + self._queue.put(('post', None)) + log_msg = "Post installation setup phase started." + self._queue.put(('log', log_msg)) + self._postinst_phase = True + +- elif action == self.PKG_SCRIPTLET: ++ elif action == dnf.transaction.PKG_SCRIPTLET: + # Log the exact package nevra, build time and checksum + nevra = "%s-%s.%s" % (package.name, package.evr, package.arch) + log_msg = "Configuring (running scriptlet for): %s %s %s" % (nevra, package.buildtime, package.returnIdSum()[1]) +@@ -210,7 +211,7 @@ class PayloadRPMDisplay(dnf.callback.TransactionProgress): + #self.cnt += 1 + self._queue.put(('configure', msg)) + +- elif action == self.PKG_VERIFY: ++ elif action == dnf.transaction.PKG_VERIFY: + msg = '%s.%s (%d/%d)' % (package.name, package.arch, ts_done, ts_total) + self._queue.put(('verify', msg)) + +-- +2.18.0.rc2 + diff --git a/anaconda.spec b/anaconda.spec index d46eaa9..65b47c0 100644 --- a/anaconda.spec +++ b/anaconda.spec @@ -7,7 +7,7 @@ Summary: Graphical system installer Name: anaconda Version: 29.18 -Release: 1%{?dist} +Release: 1%{?dist}.1 License: GPLv2+ and MIT Group: Applications/System URL: http://fedoraproject.org/wiki/Anaconda @@ -19,6 +19,13 @@ URL: http://fedoraproject.org/wiki/Anaconda # make dist Source0: %{name}-%{version}.tar.bz2 +# Initial DNF 3 compat fixes, submitted upstream: +# https://github.com/rhinstaller/anaconda/pull/1515 +# These (or improved versions) should be in 29.19 +Patch0: 0001-DNF-3-config-substitutions-moved-from-dnf-to-libdnf.patch +Patch1: 0002-DNF-3-Update-size-calculations-for-transaction-item-.patch +Patch2: 0003-DNF-3-progress-callback-constants-moved-to-dnf.trans.patch + # Versions of required components (done so we make sure the buildrequires # match the requires versions of things). @@ -249,7 +256,7 @@ options. This includes driver disks, kickstarts, and finding the anaconda runtime on NFS/HTTP/FTP servers or local disks. %prep -%setup -q +%autosetup -p1 %build # use actual build-time release number, not tarball creation time release number @@ -347,6 +354,9 @@ update-desktop-database &> /dev/null || : %{_prefix}/libexec/anaconda/dd_* %changelog +* Tue Jun 26 2018 Adam Williamson - 29.18-1.fc29.1 +- Initial DNF 3 compatibility via downstream patches + * Mon Jun 25 2018 Martin Kolman - 29.18-1 - Add tests for the DASD module (vponcova) - Run the DASD formatting task in UI (vponcova)