fix setup fail in decode

This commit is contained in:
zhanglu 2020-01-16 20:08:48 +08:00
parent b3fb4cdbb8
commit 90ca24f9c8
2 changed files with 32 additions and 1 deletions

View File

@ -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 <buildteam@openeuler.org> - 29.24.7-24
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:fix setup fail in decode
* Thu Jan 16 2020 openEuler Buildteam <buildteam@openeuler.org> - 29.24.7-23
- Type:enhancement
- Id:NA

View File

@ -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