summaryrefslogtreecommitdiff
path: root/lang/python27
diff options
context:
space:
mode:
authorryoon <ryoon@pkgsrc.org>2016-07-11 12:17:13 +0000
committerryoon <ryoon@pkgsrc.org>2016-07-11 12:17:13 +0000
commitc15e91b7063efd2dd184417846f09d3a58617803 (patch)
treeb11ce6479eb6c9e164a6c5432f37b6cd79d48ef8 /lang/python27
parentf879c85edab413920310dc81ddfa95c3f92dd4cb (diff)
downloadpkgsrc-c15e91b7063efd2dd184417846f09d3a58617803.tar.gz
Bump PKGREVISION. Do not assume longer name for POSIX semaphore under NetBSD
According to sem_open(3) man page, NetBSD supports 15 chars length. Fix SemLock errno 63 ENAMETOOLONG under NetBSD.
Diffstat (limited to 'lang/python27')
-rw-r--r--lang/python27/Makefile3
-rw-r--r--lang/python27/distinfo3
-rw-r--r--lang/python27/patches/patch-Modules___multiprocessing_semaphore.c36
3 files changed, 40 insertions, 2 deletions
diff --git a/lang/python27/Makefile b/lang/python27/Makefile
index 49a389bea82..01733fbdfc9 100644
--- a/lang/python27/Makefile
+++ b/lang/python27/Makefile
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.61 2016/07/02 15:05:43 adam Exp $
+# $NetBSD: Makefile,v 1.62 2016/07/11 12:17:13 ryoon Exp $
.include "dist.mk"
PKGNAME= python27-${PY_DISTVERSION}
+PKGREVISION= 1
CATEGORIES= lang python
MAINTAINER= pkgsrc-users@NetBSD.org
diff --git a/lang/python27/distinfo b/lang/python27/distinfo
index a7b1dd46dbe..abfb07be7a9 100644
--- a/lang/python27/distinfo
+++ b/lang/python27/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.55 2016/07/02 15:05:43 adam Exp $
+$NetBSD: distinfo,v 1.56 2016/07/11 12:17:13 ryoon Exp $
SHA1 (Python-2.7.12.tar.xz) = 05360b8ade117b35e266b2004a7f1f11250c6dcd
RMD160 (Python-2.7.12.tar.xz) = c330f6ac08ed67f307de0e726a288bab16c832d5
@@ -8,6 +8,7 @@ SHA1 (patch-Include_pyerrors.h) = 0d2cd52d18cc719b895fa32ed7e11c6cb15bae54
SHA1 (patch-Include_pyport.h) = f3e4ddbc954425a65301465410911222ca471320
SHA1 (patch-Lib_distutils_unixccompiler.py) = db16c9aca2f29730945f28247b88b18828739bbb
SHA1 (patch-Lib_multiprocessing_process.py) = 15699bd8ec822bf54a0631102e00e0a34f882803
+SHA1 (patch-Modules___multiprocessing_semaphore.c) = 03b9c33ef38da383d5f7c2c84c17fe38cdd2911e
SHA1 (patch-Modules__ssl.c) = 6e68f88ad205106691900f091a897ffe0a4c363c
SHA1 (patch-Modules_getaddrinfo.c) = aa699d257f1bc98b9a3183a21324053e134409d1
SHA1 (patch-Modules_getpath.c) = 9bb2c040895ad6bbe4d0b5807803723b5437d47b
diff --git a/lang/python27/patches/patch-Modules___multiprocessing_semaphore.c b/lang/python27/patches/patch-Modules___multiprocessing_semaphore.c
new file mode 100644
index 00000000000..63eb18d0225
--- /dev/null
+++ b/lang/python27/patches/patch-Modules___multiprocessing_semaphore.c
@@ -0,0 +1,36 @@
+$NetBSD: patch-Modules___multiprocessing_semaphore.c,v 1.1 2016/07/11 12:17:13 ryoon Exp $
+
+--- Modules/_multiprocessing/semaphore.c.orig 2016-06-25 21:49:31.000000000 +0000
++++ Modules/_multiprocessing/semaphore.c
+@@ -424,7 +424,11 @@ newsemlockobject(PyTypeObject *type, SEM
+ static PyObject *
+ semlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+ {
++#if defined(__NetBSD__)
++ char buffer[15];
++#else
+ char buffer[256];
++#endif
+ SEM_HANDLE handle = SEM_FAILED;
+ int kind, maxvalue, value;
+ PyObject *result;
+@@ -444,10 +448,19 @@ semlock_new(PyTypeObject *type, PyObject
+ * _PyOS_URandom() are treated as unsigned long to ensure that the filename
+ * is valid (no special characters). */
+ do {
++#if defined(__NetBSD__)
++ unsigned char suffix1;
++ unsigned char suffix2;
++ _PyOS_URandom((char *)&suffix1, sizeof(suffix1));
++ _PyOS_URandom((char *)&suffix2, sizeof(suffix2));
++ PyOS_snprintf(buffer, sizeof(buffer), "/mp%ld-%x%x", (long)getpid(),
++ suffix1, suffix2);
++#else
+ unsigned long suffix;
+ _PyOS_URandom((char *)&suffix, sizeof(suffix));
+ PyOS_snprintf(buffer, sizeof(buffer), "/mp%ld-%lu", (long)getpid(),
+ suffix);
++#endif
+ SEM_CLEAR_ERROR();
+ handle = SEM_CREATE(buffer, value, maxvalue);
+ } while ((handle == SEM_FAILED) && (errno == EEXIST) && (++try < 100));