Add patch to adapt to rpm Python bindings changing from bytes to strings (RH#1699432)

This commit is contained in:
Neal Gompa 2019-04-12 21:59:16 -04:00
parent cdacbd1c85
commit 7f741c1b21
2 changed files with 51 additions and 2 deletions

View File

@ -0,0 +1,36 @@
From e9f51002c7dd0749723843f0c2270789faa01956 Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa13@gmail.com>
Date: Fri, 12 Apr 2019 21:28:13 -0400
Subject: [PATCH] creator: Change to text strings for reading file list from
rpm
RPM changed its Python bindings for the RPM 4.15 release so that
everything is returned as text strings rather than byte arrays.
Adapt accordingly.
---
imgcreate/creator.py | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 51d92c7..e77a532 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -306,12 +306,9 @@ class ImageCreator(object):
def get_version(header):
version = None
for f in header['filenames']:
- if f.startswith(b'/boot/vmlinuz-'):
+ if f.startswith('/boot/vmlinuz-'):
version = f[14:]
- if version is None:
- return version
- else:
- return version.decode("utf-8")
+ return version
ts = rpm.TransactionSet(self._instroot)
--
2.20.1

View File

@ -17,7 +17,7 @@
Summary: Tools for building live CDs
Name: livecd-tools
Version: 26.1
Release: 3%{?dist}
Release: 4%{?dist}
Epoch: 1
License: GPLv2
URL: https://github.com/livecd-tools/livecd-tools
@ -27,6 +27,10 @@ Source0: https://releases.pagure.org/%{name}/%{name}-%{version}.tar.gz
## Use systemctl instead of chkconfig (rhbz#1696064)
Patch0001: 0001-Use-systemctl-instead-of-chkconfig-for-enabling-disa.patch
# Proposed changes
## Change from bytearrays to strings for data from rpm Python bindings
Patch0101: 0101-creator-Change-to-text-strings-for-reading-file-list.patch
%if %{with python2}
BuildRequires: python2-devel
%endif
@ -157,7 +161,13 @@ Tools for installing Live CD ISOs to different mediums
%endif
%prep
%autosetup -p1
%setup -q
%patch0001 -p1
%if 0%{?fedora} >= 31
# Apply only if new rpm Python binding semantics exist
%patch0101 -p1
%endif
%build
# Nothing to do
@ -221,6 +231,9 @@ rm -rfv %{buildroot}%{_mandir}/man8/livecd-iso-to-*
%endif
%changelog
* Fri Apr 12 2019 Neal Gompa <ngompa13@gmail.com> - 1:26.1-4
- Add patch to adapt to rpm Python bindings changing from bytes to strings (RH#1699432)
* Thu Apr 04 2019 Neal Gompa <ngompa13@gmail.com> - 1:26.1-3
- Backport fix from upstream to use systemctl instead of chkconfig (RH#1696064)