From 90ca24f9c80db75222a712c90accb217c1bf4d36 Mon Sep 17 00:00:00 2001 From: zhanglu Date: Thu, 16 Jan 2020 20:08:48 +0800 Subject: [PATCH] fix setup fail in decode --- anaconda.spec | 9 ++++++++- bugfix-setup-fail-in-decode.patch | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 bugfix-setup-fail-in-decode.patch diff --git a/anaconda.spec b/anaconda.spec index bae2d30..8aa48b4 100644 --- a/anaconda.spec +++ b/anaconda.spec @@ -3,7 +3,7 @@ Name: anaconda Version: 29.24.7 -Release: 23 +Release: 24 Summary: Graphical system installer License: GPLv2+ and MIT URL: https://fedoraproject.org/wiki/Anaconda @@ -45,6 +45,7 @@ Patch9027: anaconda-add-boot-options-for-raid-3408.patch Patch9028: anaconda-add-kdump-parameter-into-kernel-cmdline.patch Patch9029: anaconda-skip-checks-if-no-username-is-set.patch Patch9030: anaconda-modify-openeuler-in-welcome-to-lowercase.patch +Patch9031: bugfix-setup-fail-in-decode.patch BuildRequires: audit-libs-devel libtool gettext-devel >= 0.19.8 gtk3-devel >= 3.22.17 BuildRequires: gtk-doc gtk3-devel-docs >= 3.22.17 glib2-doc gobject-introspection-devel @@ -217,6 +218,12 @@ update-desktop-database &> /dev/null || : %{_datadir}/gtk-doc %changelog +* Thu Jan 16 2020 openEuler Buildteam - 29.24.7-24 +- Type:bugfix +- Id:NA +- SUG:NA +- DESC:fix setup fail in decode + * Thu Jan 16 2020 openEuler Buildteam - 29.24.7-23 - Type:enhancement - Id:NA diff --git a/bugfix-setup-fail-in-decode.patch b/bugfix-setup-fail-in-decode.patch new file mode 100644 index 0000000..51612d6 --- /dev/null +++ b/bugfix-setup-fail-in-decode.patch @@ -0,0 +1,24 @@ +diff -urNp a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py +--- a/pyanaconda/bootloader.py 2020-01-16 20:01:15.862288105 +0800 ++++ b/pyanaconda/bootloader.py 2020-01-16 20:03:58.044568791 +0800 +@@ -2491,7 +2491,7 @@ def writeSysconfigKernel(storage, versio + log.error("failed to get package name for default kernel") + return + +- kernel = h.name.decode() ++ kernel = h.name.encode().decode() + + f = open(util.getSysroot() + "/etc/sysconfig/kernel", "w+") + f.write("# UPDATEDEFAULT specifies if new-kernel-pkg should make\n" +diff -urNp a/pyanaconda/payload/__init__.py b/pyanaconda/payload/__init__.py +--- a/pyanaconda/payload/__init__.py 2020-01-16 20:01:15.822287542 +0800 ++++ b/pyanaconda/payload/__init__.py 2020-01-16 20:03:32.604211014 +0800 +@@ -1112,7 +1112,7 @@ class PackagePayload(Payload): + ts = rpm.TransactionSet(util.getSysroot()) + mi = ts.dbMatch('providename', 'kernel') + for hdr in mi: +- unicode_fnames = (f.decode("utf-8") for f in hdr.filenames) ++ unicode_fnames = (f.encode().decode("utf-8") for f in hdr.filenames) + # Find all /boot/vmlinuz- files and strip off vmlinuz- + files.extend((f.split("/")[-1][8:] for f in unicode_fnames + if fnmatch(f, "/boot/vmlinuz-*") or -- Gitee