From 8c7483b422a905b347f67c3ea79d5c8f4f0a3bd9 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 26 Jun 2018 14:45:06 -0700 Subject: [PATCH] Patch for DNF 3 compatibility --- ...allback-constants-moved-to-dnf.trans.patch | 43 +++++++++++++++++++ lorax.spec | 10 ++++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 0001-DNF-3-progress-callback-constants-moved-to-dnf.trans.patch diff --git a/0001-DNF-3-progress-callback-constants-moved-to-dnf.trans.patch b/0001-DNF-3-progress-callback-constants-moved-to-dnf.trans.patch new file mode 100644 index 0000000..408dc52 --- /dev/null +++ b/0001-DNF-3-progress-callback-constants-moved-to-dnf.trans.patch @@ -0,0 +1,43 @@ +From 5b0c4856f50f1a54ca39eb38691655cab43ba143 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Tue, 26 Jun 2018 14:02:59 -0700 +Subject: [PATCH] DNF 3: progress callback constants moved to dnf.transaction + +Signed-off-by: Adam Williamson +--- + src/pylorax/dnfhelper.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/pylorax/dnfhelper.py b/src/pylorax/dnfhelper.py +index 39aadd56..aa1f9804 100644 +--- a/src/pylorax/dnfhelper.py ++++ b/src/pylorax/dnfhelper.py +@@ -23,6 +23,7 @@ + import logging + logger = logging.getLogger("pylorax.dnfhelper") + import dnf ++import dnf.transaction + import collections + import time + import pylorax.output as output +@@ -93,7 +94,7 @@ class LoraxRpmCallback(dnf.callback.TransactionProgress): + self._last_ts = None + + def progress(self, package, action, ti_done, ti_total, ts_done, ts_total): +- if action == self.PKG_INSTALL: ++ if action == dnf.transaction.PKG_INSTALL: + # do not report same package twice + if self._last_ts == ts_done: + return +@@ -101,7 +102,7 @@ class LoraxRpmCallback(dnf.callback.TransactionProgress): + + msg = '(%d/%d) %s' % (ts_done, ts_total, package) + logger.info(msg) +- elif action == self.TRANS_POST: ++ elif action == dnf.transaction.TRANS_POST: + msg = "Performing post-installation setup tasks" + logger.info(msg) + +-- +2.18.0.rc2 + diff --git a/lorax.spec b/lorax.spec index 5ab1267..532d7a6 100644 --- a/lorax.spec +++ b/lorax.spec @@ -4,7 +4,7 @@ Name: lorax Version: 29.8 -Release: 1%{?dist} +Release: 1%{?dist}.1 Summary: Tool for creating the anaconda install images Group: Applications/System @@ -16,6 +16,10 @@ URL: https://github.com/weldr/lorax # tito build --tgz Source0: %{name}-%{version}.tar.gz +# DNF 3 compatibility fix +# https://github.com/weldr/lorax/pull/388 +Patch0: 0001-DNF-3-progress-callback-constants-moved-to-dnf.trans.patch + BuildRequires: python3-devel Requires: lorax-templates @@ -156,6 +160,7 @@ build images, etc. from the command line. %prep %setup -q -n %{name}-%{version} +%patch0 -p1 %build @@ -219,6 +224,9 @@ getent passwd weldr >/dev/null 2>&1 || useradd -r -g weldr -d / -s /sbin/nologin %{python3_sitelib}/composer/* %changelog +* Tue Jun 26 2018 Adam Williamson - 29.8-1.fc29.1 +- Patch for DNF 3 compatibility + * Fri Jun 22 2018 Brian C. Lane 29.8-1 - Fixing bug where test did not try to import pylorax.version (sophiafondell) - Add the ability to enable DNF plugins for lorax (bcl@redhat.com)