summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle Manna2016-01-11 08:10:45 -0800
committerKyle Manna2016-01-11 08:28:22 -0800
commitfce98a748a9fa6b47021ca0d2ff417e55d8f1240 (patch)
tree177e881a7fe28b7df51321d48d56e9d0eed3002a
parent8001b0c44dea4adaff039c39f97a70aaf0b3699c (diff)
downloadaur-fce98a748a9fa6b47021ca0d2ff417e55d8f1240.tar.gz
release: v0.5-3 start fixing Python 3 issues
* Start at fixing the thigns that changed with Python 3. * Not sure that this works.
-rw-r--r--.SRCINFO4
-rw-r--r--0001-storage-Python-3-fix-for-izip.patch31
-rw-r--r--0002-storage-Python-3-fix-for-imap.patch31
-rw-r--r--PKGBUILD4
4 files changed, 67 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 19552e409e6b..4438d4de9559 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Mon Jan 11 16:17:48 UTC 2016
+# Mon Jan 11 16:28:10 UTC 2016
pkgbase = python-kademlia
pkgdesc = Distributed hash table for decentralized peer-to-peer computer networks
pkgver = 0.5
- pkgrel = 2
+ pkgrel = 3
url = http://github.com/bmuller/kademlia
arch = any
license = MIT
diff --git a/0001-storage-Python-3-fix-for-izip.patch b/0001-storage-Python-3-fix-for-izip.patch
new file mode 100644
index 000000000000..68fbdc691fc6
--- /dev/null
+++ b/0001-storage-Python-3-fix-for-izip.patch
@@ -0,0 +1,31 @@
+From 2b8bc2209ef356feabf6cd60ab7abbc54a99018b Mon Sep 17 00:00:00 2001
+From: Kyle Manna <kyle@kylemanna.com>
+Date: Mon, 11 Jan 2016 08:23:16 -0800
+Subject: [PATCH 1/2] storage: Python 3 fix for izip
+
+* Work with both.
+---
+ kademlia/storage.py | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/kademlia/storage.py b/kademlia/storage.py
+index 3cc5e5e..1116a9c 100644
+--- a/kademlia/storage.py
++++ b/kademlia/storage.py
+@@ -1,5 +1,12 @@
+ import time
+-from itertools import izip
++
++try:
++ # Python 2
++ from itertools import izip
++except ImportError:
++ # Python 3
++ izip = zip
++
+ from itertools import imap
+ from itertools import takewhile
+ import operator
+--
+2.7.0
+
diff --git a/0002-storage-Python-3-fix-for-imap.patch b/0002-storage-Python-3-fix-for-imap.patch
new file mode 100644
index 000000000000..7065504ae404
--- /dev/null
+++ b/0002-storage-Python-3-fix-for-imap.patch
@@ -0,0 +1,31 @@
+From c71a3700ac264cd62ac2e58cbab1a422d292f0a6 Mon Sep 17 00:00:00 2001
+From: Kyle Manna <kyle@kylemanna.com>
+Date: Mon, 11 Jan 2016 08:23:16 -0800
+Subject: [PATCH 2/2] storage: Python 3 fix for imap
+
+* Work with both.
+---
+ kademlia/storage.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/kademlia/storage.py b/kademlia/storage.py
+index 1116a9c..41610da 100644
+--- a/kademlia/storage.py
++++ b/kademlia/storage.py
+@@ -3,11 +3,12 @@ import time
+ try:
+ # Python 2
+ from itertools import izip
++ from itertools import imap
+ except ImportError:
+ # Python 3
+ izip = zip
++ imap = map
+
+-from itertools import imap
+ from itertools import takewhile
+ import operator
+ from collections import OrderedDict
+--
+2.7.0
+
diff --git a/PKGBUILD b/PKGBUILD
index 7ff637d7ac13..ab8f4eabfcd5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=python-kademlia
_pkgname=${pkgname/python-/}
pkgver=0.5
-pkgrel=2
+pkgrel=3
pkgdesc="Distributed hash table for decentralized peer-to-peer computer networks"
url="http://github.com/bmuller/kademlia"
depends=('python' 'python-twisted' 'python-rpcudp')
@@ -14,6 +14,8 @@ sha256sums=('5069c5d404226165ed30b9384be5dedf5f16b065ddf2344c66aa3222583e1d94')
build() {
cd "$srcdir/$_pkgname-$pkgver"
+ patch -p1 < "$srcdir/../0001-storage-Python-3-fix-for-izip.patch"
+ patch -p1 < "$srcdir/../0002-storage-Python-3-fix-for-imap.patch"
python setup.py build
}