Patch for DNF 3 compatibility

This commit is contained in:
Adam Williamson 2018-06-26 14:45:06 -07:00
parent 197c674e4f
commit 8c7483b422
2 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,43 @@
From 5b0c4856f50f1a54ca39eb38691655cab43ba143 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
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 <awilliam@redhat.com>
---
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

View File

@ -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 <awilliam@redhat.com> - 29.8-1.fc29.1
- Patch for DNF 3 compatibility
* Fri Jun 22 2018 Brian C. Lane <bcl@redhat.com> 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)