Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pyzor/, dev-python/pyzor/files/
Date: Sun, 25 Mar 2018 14:30:29
Message-Id: 1521988213.4d1fb37992ef3d6cbe0cd4ed63d4b796428ccbd4.mjo@gentoo
1 commit: 4d1fb37992ef3d6cbe0cd4ed63d4b796428ccbd4
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 25 14:27:57 2018 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 25 14:30:13 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d1fb379
7
8 dev-python/pyzor: add another patch to keep 2to3 from breaking things.
9
10 The pyzor-1.0.0 build system still runs 2to3 and that's breaking the
11 (now-patched) client, because it was patched to support python-3.x
12 already. This commit adds another patch that should prevent 2to3 from
13 breaking the client by giving it something to fix.
14
15 Bug: https://bugs.gentoo.org/643692
16 Package-Manager: Portage-2.3.24, Repoman-2.3.6
17
18 .../files/unfix-configparser-compat-for-2to3.patch | 41 ++++++++++++++++++++++
19 dev-python/pyzor/pyzor-1.0.0-r1.ebuild | 5 ++-
20 2 files changed, 45 insertions(+), 1 deletion(-)
21
22 diff --git a/dev-python/pyzor/files/unfix-configparser-compat-for-2to3.patch b/dev-python/pyzor/files/unfix-configparser-compat-for-2to3.patch
23 new file mode 100644
24 index 00000000000..93d0f07a257
25 --- /dev/null
26 +++ b/dev-python/pyzor/files/unfix-configparser-compat-for-2to3.patch
27 @@ -0,0 +1,41 @@
28 +From e4f06e21f697b863fa45a50e535ff0c6e3621a60 Mon Sep 17 00:00:00 2001
29 +From: Michael Orlitzky <michael@××××××××.com>
30 +Date: Sun, 25 Mar 2018 10:14:21 -0400
31 +Subject: [PATCH 1/1] scripts/pyzor: undo ConfigParser python-3.x
32 + compatibility.
33 +
34 +The build system for pyzor-1.0.0 still runs the 2to3 utility on the
35 +scripts to be installed. As an unintended side-effect, the python-3.x
36 +"try... import... except" compatibility block for the ConfigParser <->
37 +configparser module gets modified (the module name gets mistakenly
38 +lowercased).
39 +
40 +This commit puts back the python-2.x "import ConfigParser" line
41 +unconditionally, and we'll have to rely on 2to3 to fix it when run
42 +under python-3.x. In newer versions of pyzor, the automatic 2to3 will
43 +not happen.
44 +
45 +Bug: https://bugs.gentoo.org/643692
46 +---
47 + scripts/pyzor | 5 +----
48 + 1 file changed, 1 insertion(+), 4 deletions(-)
49 +
50 +diff --git a/scripts/pyzor b/scripts/pyzor
51 +index 86c6f7d..2750d92 100755
52 +--- a/scripts/pyzor
53 ++++ b/scripts/pyzor
54 +@@ -16,10 +16,7 @@ import optparse
55 + import tempfile
56 + import threading
57 +
58 +-try:
59 +- import configparser as ConfigParser
60 +-except ImportError:
61 +- import ConfigParser
62 ++import ConfigParser
63 +
64 + import pyzor.digest
65 + import pyzor.client
66 +--
67 +2.16.1
68 +
69
70 diff --git a/dev-python/pyzor/pyzor-1.0.0-r1.ebuild b/dev-python/pyzor/pyzor-1.0.0-r1.ebuild
71 index 14e1ee84072..ce7d0e7b5cf 100644
72 --- a/dev-python/pyzor/pyzor-1.0.0-r1.ebuild
73 +++ b/dev-python/pyzor/pyzor-1.0.0-r1.ebuild
74 @@ -39,7 +39,10 @@ REQUIRED_USE="pyzord? ( || ( gdbm mysql redis ) )
75 test? ( gdbm mysql redis )"
76 S="${WORKDIR}/${PN}-release-${MY_PV}"
77
78 -PATCHES=( "${FILESDIR}/read-stdin-as-binary-in-get_input_msg.patch" )
79 +PATCHES=(
80 + "${FILESDIR}/read-stdin-as-binary-in-get_input_msg.patch"
81 + "${FILESDIR}/unfix-configparser-compat-for-2to3.patch"
82 +)
83
84 python_test() {
85 # The suite is py2 friendly only