pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/python27 Bump PKGREVISION. Do not assume longer n...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c9f955e256cf
branches:  trunk
changeset: 349592:c9f955e256cf
user:      ryoon <ryoon%pkgsrc.org@localhost>
date:      Mon Jul 11 12:17:13 2016 +0000

description:
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:

 lang/python27/Makefile                                            |   3 +-
 lang/python27/distinfo                                            |   3 +-
 lang/python27/patches/patch-Modules___multiprocessing_semaphore.c |  36 ++++++++++
 3 files changed, 40 insertions(+), 2 deletions(-)

diffs (71 lines):

diff -r 98af59734638 -r c9f955e256cf lang/python27/Makefile
--- a/lang/python27/Makefile    Mon Jul 11 09:55:32 2016 +0000
+++ b/lang/python27/Makefile    Mon Jul 11 12:17:13 2016 +0000
@@ -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@localhost
diff -r 98af59734638 -r c9f955e256cf lang/python27/distinfo
--- a/lang/python27/distinfo    Mon Jul 11 09:55:32 2016 +0000
+++ b/lang/python27/distinfo    Mon Jul 11 12:17:13 2016 +0000
@@ -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_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 -r 98af59734638 -r c9f955e256cf lang/python27/patches/patch-Modules___multiprocessing_semaphore.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/python27/patches/patch-Modules___multiprocessing_semaphore.c Mon Jul 11 12:17:13 2016 +0000
@@ -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));



Home | Main Index | Thread Index | Old Index