Add a patch to fix builds against python 3.6.3 (jkonecny).

Gettext can sometimes return bytes which needs to be converted and this
is handled in the i18n.py source file.
This commit is contained in:
Chris Lumens 2017-10-19 11:43:52 -04:00
parent 5d0be2cee4
commit 30b0c01504
3 changed files with 47 additions and 1 deletions

View File

@ -0,0 +1,27 @@
diff -ruN pykickstart-2.35.orig/pykickstart/commands/reqpart.py pykickstart-2.35/pykickstart/commands/reqpart.py
--- pykickstart-2.35.orig/pykickstart/commands/reqpart.py 2017-10-19 11:25:41.982773586 -0400
+++ pykickstart-2.35/pykickstart/commands/reqpart.py 2017-10-19 11:34:38.258364922 -0400
@@ -21,9 +21,7 @@
from pykickstart.errors import KickstartParseError, formatErrorMsg
from pykickstart.options import KSOptionParser
-import gettext
-# typeshed is missing the stub for ldgettext
-_ = lambda x: gettext.ldgettext("pykickstart", x) # type: ignore
+from pykickstart.i18n import _
class F23_ReqPart(KickstartCommand):
removedKeywords = KickstartCommand.removedKeywords
diff -ruN pykickstart-2.35.orig/pykickstart/commands/snapshot.py pykickstart-2.35/pykickstart/commands/snapshot.py
--- pykickstart-2.35.orig/pykickstart/commands/snapshot.py 2017-10-19 11:25:41.982773586 -0400
+++ pykickstart-2.35/pykickstart/commands/snapshot.py 2017-10-19 11:34:47.977448130 -0400
@@ -23,8 +23,7 @@
from pykickstart.options import KSOptionParser
from pykickstart.constants import SNAPSHOT_WHEN_POST_INSTALL, SNAPSHOT_WHEN_PRE_INSTALL
-import gettext
-_ = lambda x: gettext.ldgettext("pykickstart", x)
+from pykickstart.i18n import _
class RHEL7_SnapshotData(BaseData):
removedKeywords = BaseData.removedKeywords

View File

@ -0,0 +1,12 @@
diff -ruN pykickstart-2.35.orig/po/Makefile pykickstart-2.35/po/Makefile
--- pykickstart-2.35.orig/po/Makefile 2017-10-19 12:52:22.672153378 -0400
+++ pykickstart-2.35/po/Makefile 2017-10-19 12:52:32.443236072 -0400
@@ -12,7 +12,7 @@
# PO catalog handling
MSGMERGE = msgmerge -v
-XGETTEXT = ../translation-canary/xgettext_werror.sh --default-domain=$(NLSPACKAGE) \
+XGETTEXT = xgettext --default-domain=$(NLSPACKAGE) \
--add-comments
MSGFMT = msgfmt --statistics --verbose

View File

@ -1,6 +1,6 @@
Name: pykickstart
Version: 2.35
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2 and MIT
Group: System Environment/Libraries
Summary: Python utilities for manipulating kickstart files.
@ -9,6 +9,8 @@ Url: http://fedoraproject.org/wiki/pykickstart
# our distribution. Thus the source is only available from
# within this srpm.
Source0: %{name}-%{version}.tar.gz
Patch0: 0001-Call-the-_-method-from-i18n.py.patch
Patch1: 0002-Disable-translation-canary.patch
BuildArch: noarch
@ -60,6 +62,8 @@ the pykickstart package.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
rm -rf %{py3dir}
mkdir %{py3dir}
@ -121,6 +125,9 @@ popd
%{python3_sitelib}/pykickstart/locale/
%changelog
* Thu Oct 19 2017 Chris Lumens <clumens@redhat.com> - 2.35-2
- Add a patch to fix builds against python 3.6.3 (jkonecny).
* Wed Jun 14 2017 Chris Lumens <clumens@redhat.com> - 2.35-1
- Fix an ambiguous string in a snapshot command test. (clumens)
- Snapshot command is also for Fedora 26 (jkonecny)