Mon Nov 3 14:12:52 2014 UTC ()
Pullup ticket #4536 - requested by spz
lang/python27: security update

Revisions pulled up:
- lang/python27/Makefile                                        1.46
- lang/python27/distinfo                                        1.47
- lang/python27/patches/patch-Misc_NEWS                         1.5
- lang/python27/patches/patch-Modules_getpath.c                 1.2
- lang/python27/patches/patch-Objects_unicodeobject.c           1.1
- lang/python27/patches/patch-Python_codecs.c                   1.1
- lang/python27/patches/patch-ab                                1.3
- lang/python27/patches/patch-ad                                1.2
- lang/python27/patches/patch-ae                                1.2
- lang/python27/patches/patch-ah                                1.3
- lang/python27/patches/patch-am                                1.18
- lang/python27/patches/patch-an                                1.2
- lang/python27/patches/patch-ao                                1.5
- lang/python27/patches/patch-au                                1.7
- lang/python27/patches/patch-av                                1.2
- lang/python27/patches/patch-aw                                1.2
- lang/python27/patches/patch-ax                                1.5
- lang/python27/patches/patch-az                                1.4
- lang/python27/patches/patch-pyconfig.h.in                     1.3
- lang/python27/patches/patch-xa                                1.2

---
   Module Name:	pkgsrc
   Committed By:	spz
   Date:		Sun Nov  2 13:31:11 UTC 2014

   Modified Files:
   	pkgsrc/lang/python27: Makefile distinfo
   	pkgsrc/lang/python27/patches: patch-Misc_NEWS patch-Modules_getpath.c
   	    patch-ab patch-ad patch-ae patch-ah patch-am patch-an patch-ao
   	    patch-au patch-av patch-aw patch-ax patch-az patch-pyconfig.h.in
   	    patch-xa
   Added Files:
   	pkgsrc/lang/python27/patches: patch-Objects_unicodeobject.c
   	    patch-Python_codecs.c

   Log Message:
   add the patches for Python issue 22518, also known as 22470, from
   the python source repository.
   Refresh patches


(tron)
diff -r1.45 -r1.45.2.1 pkgsrc/lang/python27/Makefile
diff -r1.46 -r1.46.2.1 pkgsrc/lang/python27/distinfo
diff -r1.4 -r1.4.2.1 pkgsrc/lang/python27/patches/patch-Misc_NEWS
diff -r1.1 -r1.1.12.1 pkgsrc/lang/python27/patches/patch-Modules_getpath.c
diff -r0 -r1.1.2.2 pkgsrc/lang/python27/patches/patch-Objects_unicodeobject.c
diff -r0 -r1.1.2.2 pkgsrc/lang/python27/patches/patch-Python_codecs.c
diff -r1.2 -r1.2.20.1 pkgsrc/lang/python27/patches/patch-ab
diff -r1.1.1.1 -r1.1.1.1.30.1 pkgsrc/lang/python27/patches/patch-ad
diff -r1.1.1.1 -r1.1.1.1.30.1 pkgsrc/lang/python27/patches/patch-ae
diff -r1.1.1.1 -r1.1.1.1.30.1 pkgsrc/lang/python27/patches/patch-an
diff -r1.1.1.1 -r1.1.1.1.30.1 pkgsrc/lang/python27/patches/patch-av
diff -r1.1.1.1 -r1.1.1.1.30.1 pkgsrc/lang/python27/patches/patch-aw
diff -r1.2 -r1.2.12.1 pkgsrc/lang/python27/patches/patch-ah
diff -r1.2 -r1.2.12.1 pkgsrc/lang/python27/patches/patch-pyconfig.h.in
diff -r1.17 -r1.17.4.1 pkgsrc/lang/python27/patches/patch-am
diff -r1.4 -r1.4.12.1 pkgsrc/lang/python27/patches/patch-ao
diff -r1.4 -r1.4.12.1 pkgsrc/lang/python27/patches/patch-ax
diff -r1.6 -r1.6.12.1 pkgsrc/lang/python27/patches/patch-au
diff -r1.3 -r1.3.12.1 pkgsrc/lang/python27/patches/patch-az
diff -r1.1 -r1.1.18.1 pkgsrc/lang/python27/patches/patch-xa

cvs diff -r1.45 -r1.45.2.1 pkgsrc/lang/python27/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/python27/Makefile 2014/07/17 15:26:49 1.45
+++ pkgsrc/lang/python27/Makefile 2014/11/03 14:12:52 1.45.2.1
@@ -1,18 +1,19 @@ @@ -1,18 +1,19 @@
1# $NetBSD: Makefile,v 1.45 2014/07/17 15:26:49 ryoon Exp $ 1# $NetBSD: Makefile,v 1.45.2.1 2014/11/03 14:12:52 tron Exp $
2 2
3.include "dist.mk" 3.include "dist.mk"
4 4
5PKGNAME= python27-${PY_DISTVERSION} 5PKGNAME= python27-${PY_DISTVERSION}
 6PKGREVISION= 1
6CATEGORIES= lang python 7CATEGORIES= lang python
7 8
8MAINTAINER= pkgsrc-users@NetBSD.org 9MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= http://www.python.org/ 10HOMEPAGE= http://www.python.org/
10COMMENT= Interpreted, interactive, object-oriented programming language 11COMMENT= Interpreted, interactive, object-oriented programming language
11LICENSE= python-software-foundation 12LICENSE= python-software-foundation
12 13
13CONFLICTS+= python-[0-9]* 14CONFLICTS+= python-[0-9]*
14 15
15GNU_CONFIGURE= yes 16GNU_CONFIGURE= yes
16CONFIGURE_ARGS+= --with-threads 17CONFIGURE_ARGS+= --with-threads
17CONFIGURE_ARGS+= --enable-shared 18CONFIGURE_ARGS+= --enable-shared
18CONFIGURE_ARGS+= OPT=${CFLAGS:Q} 19CONFIGURE_ARGS+= OPT=${CFLAGS:Q}

cvs diff -r1.46 -r1.46.2.1 pkgsrc/lang/python27/distinfo (expand / switch to unified diff)

--- pkgsrc/lang/python27/distinfo 2014/07/26 06:19:38 1.46
+++ pkgsrc/lang/python27/distinfo 2014/11/03 14:12:52 1.46.2.1
@@ -1,37 +1,39 @@ @@ -1,37 +1,39 @@
1$NetBSD: distinfo,v 1.46 2014/07/26 06:19:38 adam Exp $ 1$NetBSD: distinfo,v 1.46.2.1 2014/11/03 14:12:52 tron Exp $
2 2
3SHA1 (Python-2.7.8.tar.xz) = 9c6281eeace0c3646fa556c8087bb1b7e033c9c4 3SHA1 (Python-2.7.8.tar.xz) = 9c6281eeace0c3646fa556c8087bb1b7e033c9c4
4RMD160 (Python-2.7.8.tar.xz) = 04d7d55ea65074a9b419e5d0920414e54691d907 4RMD160 (Python-2.7.8.tar.xz) = 04d7d55ea65074a9b419e5d0920414e54691d907
5Size (Python-2.7.8.tar.xz) = 10525244 bytes 5Size (Python-2.7.8.tar.xz) = 10525244 bytes
6SHA1 (patch-Include_node.h) = 673d148b625711ac47e4bfeb0f5b0d5b31f94d7e 6SHA1 (patch-Include_node.h) = 673d148b625711ac47e4bfeb0f5b0d5b31f94d7e
7SHA1 (patch-Include_pyerrors.h) = 3eba043c83b1d1df4918524f7b53047a6ed372ae 7SHA1 (patch-Include_pyerrors.h) = 3eba043c83b1d1df4918524f7b53047a6ed372ae
8SHA1 (patch-Include_pyport.h) = 971c7c548b92595712d0d70a0917a0ccc83b6c7e 8SHA1 (patch-Include_pyport.h) = 971c7c548b92595712d0d70a0917a0ccc83b6c7e
9SHA1 (patch-Lib_distutils_unixccompiler.py) = 39b967dc2ae648143d5841f22602a21063b4d5ea 9SHA1 (patch-Lib_distutils_unixccompiler.py) = 39b967dc2ae648143d5841f22602a21063b4d5ea
10SHA1 (patch-Lib_multiprocessing_process.py) = b47ad4cbeddbcfb4342c08c84d0d515a793815d4 10SHA1 (patch-Lib_multiprocessing_process.py) = b47ad4cbeddbcfb4342c08c84d0d515a793815d4
11SHA1 (patch-Lib_poplib.py) = 5d7f64b028abd2fd43651f27a7f2ce7efe5b0859 11SHA1 (patch-Lib_poplib.py) = 5d7f64b028abd2fd43651f27a7f2ce7efe5b0859
12SHA1 (patch-Lib_smtplib.py) = f1118bbc53b4e292eb9a28ef3ef10eb4aa553bc3 12SHA1 (patch-Lib_smtplib.py) = f1118bbc53b4e292eb9a28ef3ef10eb4aa553bc3
13SHA1 (patch-Lib_test_test__poplib.py) = 1bdef76b687d042272e35c08521d4244d2c7fbe1 13SHA1 (patch-Lib_test_test__poplib.py) = 1bdef76b687d042272e35c08521d4244d2c7fbe1
14SHA1 (patch-Lib_test_test_smtplib.py) = 9e8a7f826c7d0f493746718b49fc27ac97c2cbb1 14SHA1 (patch-Lib_test_test_smtplib.py) = 9e8a7f826c7d0f493746718b49fc27ac97c2cbb1
15SHA1 (patch-Misc_NEWS) = c9171e10227567750db8e11881aca305cd8c3a42 15SHA1 (patch-Misc_NEWS) = 262f9cb316d0f7ce1fb85296a07302f4cb2dd1a5
16SHA1 (patch-Modules___ssl.c) = aaddaea5bcd6c84d3d896c7c37f710933b8228bc 16SHA1 (patch-Modules___ssl.c) = aaddaea5bcd6c84d3d896c7c37f710933b8228bc
17SHA1 (patch-Modules_getaddrinfo.c) = 696c58c4c4bbb710fb1508d7d88864d0b08cfc79 17SHA1 (patch-Modules_getaddrinfo.c) = 696c58c4c4bbb710fb1508d7d88864d0b08cfc79
18SHA1 (patch-Modules_getpath.c) = f68b38eb90f974b67ceab3922ce7f92eb77f25c3 18SHA1 (patch-Modules_getpath.c) = aa8a54717a85f831e3ceaad19d96c43bc38aef10
19SHA1 (patch-Modules_mmapmodule.c) = 87ea76e6d8263045c1ca794ff5c75ed631a74b6d 19SHA1 (patch-Modules_mmapmodule.c) = 87ea76e6d8263045c1ca794ff5c75ed631a74b6d
20SHA1 (patch-Modules_posixmodule.c) = b8960592611499202bb5ff8521d619e0637177b6 20SHA1 (patch-Modules_posixmodule.c) = b8960592611499202bb5ff8521d619e0637177b6
21SHA1 (patch-Modules_socketmodule.c) = 960ce4af2a142c471c707de446f2d390044bbc13 21SHA1 (patch-Modules_socketmodule.c) = 960ce4af2a142c471c707de446f2d390044bbc13
 22SHA1 (patch-Objects_unicodeobject.c) = 7edf7d2b553569bc66c883b1fd516dceb13c8cde
 23SHA1 (patch-Python_codecs.c) = fce9d5f2745773b76074a8ae7389aa88fbbe4f9e
22SHA1 (patch-aa) = 990e4025bb6a37715e1f5df1831499f0ab08acfa 24SHA1 (patch-aa) = 990e4025bb6a37715e1f5df1831499f0ab08acfa
23SHA1 (patch-ab) = 0d0ae9802dfe3b85659adb16793affd8c4ffce43 25SHA1 (patch-ab) = 6a38874aaaccc878541554546835ccbf6136bbd5
24SHA1 (patch-ad) = de730b9f5a5efb56afa8bed05824b5f6579242ec 26SHA1 (patch-ad) = 061aefac15fe3834271770f0fd225e12f84d961a
25SHA1 (patch-ae) = ff6d8c6164fe3c6dc4fb33d88eb8a49d5c5442f6 27SHA1 (patch-ae) = 7fadf9e2f5fe7ad42e14f9cf9ef92e92a3a40787
26SHA1 (patch-ah) = ae3ce0656d890ca34292920bf0185f94ba847139 28SHA1 (patch-ah) = 0648597f53bef7832af589378104a4d43290714a
27SHA1 (patch-al) = 4bd68f7995f5b76c3d62f370f31568930055c76f 29SHA1 (patch-al) = 4bd68f7995f5b76c3d62f370f31568930055c76f
28SHA1 (patch-am) = 366ce0b130cc9b6d6c5354769da05bb4b5845e01 30SHA1 (patch-am) = 5e287cddd574e86e1ef07e6e862e72aacaa70b93
29SHA1 (patch-an) = 6098fbf0fc31422196cc40d3a227934523db11ca 31SHA1 (patch-an) = f1179125d2042e44b864488864144cae057171cb
30SHA1 (patch-ao) = 3a1cd2b255340fd23fc1fce8680e692581ffcec1 32SHA1 (patch-ao) = ad4377682b01a4965c84ac46e398ec5e841ee0f5
31SHA1 (patch-au) = 2a2a988ac92553d17eb898870d1adb3c30a59b66 33SHA1 (patch-au) = 98c925a32b2067055d9082a24b8a8b8b1069eb90
32SHA1 (patch-av) = a14eaf4d5db6fc3b79ed896fbfcc34ca98051af2 34SHA1 (patch-av) = 3cd52c97afe7b3331559e75b1d69c886014c1d8e
33SHA1 (patch-aw) = 15652e241f371a22c7300f46771825ea74514fa0 35SHA1 (patch-aw) = ff445b01cd4979d26baf27aabb291a803c4a2ec2
34SHA1 (patch-ax) = be7498a37a89c86d278d07c38666237215308498 36SHA1 (patch-ax) = 63948a78cbd4dd5438cd0fc1ce8a23e6ec13626c
35SHA1 (patch-az) = 56a3adedfc87cbbb0307ccb4b452665f79bde582 37SHA1 (patch-az) = e373cb7e80650b3cc9f491864ab2c2ddfd4c8395
36SHA1 (patch-pyconfig.h.in) = c4544178ecceffb6ed911df39d3a64bff665cb34 38SHA1 (patch-pyconfig.h.in) = 11aae6980d82ec577088dc4e13f5e3b5180360e6
37SHA1 (patch-xa) = 25f02b03f1c5534e1d839a5489d5a046071f32c0 39SHA1 (patch-xa) = e996624c1d4aa978f853dab31a096b8587fed7a2

cvs diff -r1.4 -r1.4.2.1 pkgsrc/lang/python27/patches/Attic/patch-Misc_NEWS (expand / switch to unified diff)

--- pkgsrc/lang/python27/patches/Attic/patch-Misc_NEWS 2014/07/02 08:22:02 1.4
+++ pkgsrc/lang/python27/patches/Attic/patch-Misc_NEWS 2014/11/03 14:12:52 1.4.2.1
@@ -1,30 +1,42 @@ @@ -1,30 +1,42 @@
1$NetBSD: patch-Misc_NEWS,v 1.4 2014/07/02 08:22:02 he Exp $ 1$NetBSD: patch-Misc_NEWS,v 1.4.2.1 2014/11/03 14:12:52 tron Exp $
2 2
3Note added fixes. 3Note added fixes.
4 4
5--- Misc/NEWS.orig 2014-05-31 18:58:39.000000000 +0000 5--- Misc/NEWS.orig 2014-06-30 02:05:39.000000000 +0000
6+++ Misc/NEWS 6+++ Misc/NEWS
7@@ -63,6 +63,9 @@ Core and Builtins 7@@ -10,6 +10,11 @@ What's New in Python 2.7.8?
 8 Core and Builtins
 9 -----------------
 10
 11+- Issue #22518: Fix integer overflow issues in latin-1 encoding.
 12+
 13+- Issue #22470: Fixed integer overflow issues in "backslashreplace" and
 14+ "xmlcharrefreplace" error handlers.
 15+
 16 - Issue #4346: In PyObject_CallMethod and PyObject_CallMethodObjArgs, don't
 17 overwrite the error set in PyObject_GetAttr.
 18
 19@@ -207,6 +212,9 @@ Core and Builtins
8 Library 20 Library
9 ------- 21 -------
10  22
11+- Issue #21766: Prevent a security hole in CGIHTTPServer by URL unquoting paths 23+- Issue #21766: Prevent a security hole in CGIHTTPServer by URL unquoting paths
12+ before checking for a CGI script at that path. 24+ before checking for a CGI script at that path.
13+ 25+
14 - Issue #10744: Fix PEP 3118 format strings on ctypes objects with a nontrivial 26 - Issue #10744: Fix PEP 3118 format strings on ctypes objects with a nontrivial
15 shape. 27 shape.
16  28
17@@ -585,6 +588,13 @@ Library 29@@ -729,6 +737,13 @@ Library
18 prevent readline() calls from consuming too much memory. Patch by Jyrki 30 prevent readline() calls from consuming too much memory. Patch by Jyrki
19 Pulliainen. 31 Pulliainen.
20  32
21+- Issue #16041: CVE-2013-1752: poplib: Limit maximum line lengths to 2048 to 33+- Issue #16041: CVE-2013-1752: poplib: Limit maximum line lengths to 2048 to
22+ prevent readline() calls from consuming too much memory. Patch by Jyrki 34+ prevent readline() calls from consuming too much memory. Patch by Jyrki
23+ Pulliainen. 35+ Pulliainen.
24+ 36+
25+- Issue #16042: CVE-2013-1752: smtplib: Limit amount of data read by 37+- Issue #16042: CVE-2013-1752: smtplib: Limit amount of data read by
26+ limiting the call to readline(). Original patch by Christian Heimes. 38+ limiting the call to readline(). Original patch by Christian Heimes.
27+ 39+
28 - Issue #12641: Avoid passing "-mno-cygwin" to the mingw32 compiler, except 40 - Issue #12641: Avoid passing "-mno-cygwin" to the mingw32 compiler, except
29 when necessary. Patch by Oscar Benjamin. 41 when necessary. Patch by Oscar Benjamin.
30  42

cvs diff -r1.1 -r1.1.12.1 pkgsrc/lang/python27/patches/patch-Modules_getpath.c (expand / switch to unified diff)

--- pkgsrc/lang/python27/patches/patch-Modules_getpath.c 2013/04/17 13:21:05 1.1
+++ pkgsrc/lang/python27/patches/patch-Modules_getpath.c 2014/11/03 14:12:52 1.1.12.1
@@ -1,20 +1,20 @@ @@ -1,20 +1,20 @@
1$NetBSD: patch-Modules_getpath.c,v 1.1 2013/04/17 13:21:05 obache Exp $ 1$NetBSD: patch-Modules_getpath.c,v 1.1.12.1 2014/11/03 14:12:52 tron Exp $
2 2
3* from cygport 2.7.3-getpath-exe-extension.patch 3* from cygport 2.7.3-getpath-exe-extension.patch
4 4
5--- Modules/getpath.c.orig 2013-04-06 14:02:37.000000000 +0000 5--- Modules/getpath.c.orig 2014-06-30 02:05:43.000000000 +0000
6+++ Modules/getpath.c 6+++ Modules/getpath.c
7@@ -436,6 +436,28 @@ calculate_path(void) 7@@ -451,6 +451,28 @@ calculate_path(void)
8 if (isxfile(progpath)) 8 if (isxfile(progpath))
9 break; 9 break;
10  10
11+#ifdef __CYGWIN__ 11+#ifdef __CYGWIN__
12+ /* 12+ /*
13+ * Cygwin automatically removes the ".exe" extension from argv[0] 13+ * Cygwin automatically removes the ".exe" extension from argv[0]
14+ * to make programs feel like they are in a more Unix-like 14+ * to make programs feel like they are in a more Unix-like
15+ * environment. Unfortunately, this can make it problemmatic for 15+ * environment. Unfortunately, this can make it problemmatic for
16+ * Cygwin to distinguish between a directory and an executable with 16+ * Cygwin to distinguish between a directory and an executable with
17+ * the same name excluding the ".exe" extension. For example, the 17+ * the same name excluding the ".exe" extension. For example, the
18+ * Cygwin Python build directory has a "Python" directory and a 18+ * Cygwin Python build directory has a "Python" directory and a
19+ * "python.exe" executable. This causes isxfile() to erroneously 19+ * "python.exe" executable. This causes isxfile() to erroneously
20+ * return false. If isdir() returns true and there is enough space 20+ * return false. If isdir() returns true and there is enough space

File Added: pkgsrc/lang/python27/patches/Attic/patch-Objects_unicodeobject.c
$NetBSD: patch-Objects_unicodeobject.c,v 1.1.2.2 2014/11/03 14:12:52 tron Exp $

taken from https://hg.python.org/cpython/rev/b2e68274aa8e:

Issue #22518: integer overflow in encoding unicode

--- Objects/unicodeobject.c.orig	2014-06-30 02:05:45.000000000 +0000
+++ Objects/unicodeobject.c
@@ -1510,9 +1510,15 @@ int unicode_decode_call_errorhandler(con
        when there are no errors in the rest of the string) */
     repptr = PyUnicode_AS_UNICODE(repunicode);
     repsize = PyUnicode_GET_SIZE(repunicode);
-    requiredsize = *outpos + repsize + insize-newpos;
+    requiredsize = *outpos;
+    if (requiredsize > PY_SSIZE_T_MAX - repsize)
+        goto overflow;
+    requiredsize += repsize;
+    if (requiredsize > PY_SSIZE_T_MAX - (insize - newpos))
+        goto overflow;
+    requiredsize += insize - newpos;
     if (requiredsize > outsize) {
-        if (requiredsize<2*outsize)
+        if (outsize <= PY_SSIZE_T_MAX/2 && requiredsize < 2*outsize)
             requiredsize = 2*outsize;
         if (_PyUnicode_Resize(output, requiredsize) < 0)
             goto onError;
@@ -1529,6 +1535,11 @@ int unicode_decode_call_errorhandler(con
   onError:
     Py_XDECREF(restuple);
     return res;
+
+  overflow:
+    PyErr_SetString(PyExc_OverflowError,
+                    "decoded result is too long for a Python string");
+    goto onError;
 }
 
 /* --- UTF-7 Codec -------------------------------------------------------- */
@@ -3646,7 +3657,7 @@ static PyObject *unicode_encode_ucs1(con
             const Py_UNICODE *collstart = p;
             const Py_UNICODE *collend = p;
             /* find all unecodable characters */
-            while ((collend < endp) && ((*collend)>=limit))
+            while ((collend < endp) && ((*collend) >= limit))
                 ++collend;
             /* cache callback name lookup (if not done yet, i.e. it's the first error) */
             if (known_errorHandler==-1) {
@@ -3666,34 +3677,41 @@ static PyObject *unicode_encode_ucs1(con
                 raise_encode_exception(&exc, encoding, startp, size, collstart-startp, collend-startp, reason);
                 goto onError;
             case 2: /* replace */
-                while (collstart++<collend)
+                while (collstart++ < collend)
                     *str++ = '?'; /* fall through */
             case 3: /* ignore */
                 p = collend;
                 break;
             case 4: /* xmlcharrefreplace */
-                respos = str-PyString_AS_STRING(res);
+                respos = str - PyString_AS_STRING(res);
                 /* determine replacement size (temporarily (mis)uses p) */
-                for (p = collstart, repsize = 0; p < collend;) {
+                requiredsize = respos;
+                for (p = collstart; p < collend;) {
                     Py_UCS4 ch = _Py_UNICODE_NEXT(p, collend);
+                    Py_ssize_t incr;
                     if (ch < 10)
-                        repsize += 2+1+1;
+                        incr = 2+1+1;
                     else if (ch < 100)
-                        repsize += 2+2+1;
+                        incr = 2+2+1;
                     else if (ch < 1000)
-                        repsize += 2+3+1;
+                        incr = 2+3+1;
                     else if (ch < 10000)
-                        repsize += 2+4+1;
+                        incr = 2+4+1;
                     else if (ch < 100000)
-                        repsize += 2+5+1;
+                        incr = 2+5+1;
                     else if (ch < 1000000)
-                        repsize += 2+6+1;
+                        incr = 2+6+1;
                     else
-                        repsize += 2+7+1;
-                }
-                requiredsize = respos+repsize+(endp-collend);
+                        incr = 2+7+1;
+                    if (requiredsize > PY_SSIZE_T_MAX - incr)
+                        goto overflow;
+                    requiredsize += incr;
+                }
+                if (requiredsize > PY_SSIZE_T_MAX - (endp - collend))
+                    goto overflow;
+                requiredsize += endp - collend;
                 if (requiredsize > ressize) {
-                    if (requiredsize<2*ressize)
+                    if (ressize <= PY_SSIZE_T_MAX/2 && requiredsize < 2*ressize)
                         requiredsize = 2*ressize;
                     if (_PyString_Resize(&res, requiredsize))
                         goto onError;
@@ -3716,11 +3734,16 @@ static PyObject *unicode_encode_ucs1(con
                 /* need more space? (at least enough for what we have+the
                    replacement+the rest of the string, so we won't have to
                    check space for encodable characters) */
-                respos = str-PyString_AS_STRING(res);
+                respos = str - PyString_AS_STRING(res);
                 repsize = PyUnicode_GET_SIZE(repunicode);
-                requiredsize = respos+repsize+(endp-collend);
+                if (respos > PY_SSIZE_T_MAX - repsize)
+                    goto overflow;
+                requiredsize = respos + repsize;
+                if (requiredsize > PY_SSIZE_T_MAX - (endp - collend))
+                    goto overflow;
+                requiredsize += endp - collend;
                 if (requiredsize > ressize) {
-                    if (requiredsize<2*ressize)
+                    if (ressize <= PY_SSIZE_T_MAX/2 && requiredsize < 2*ressize)
                         requiredsize = 2*ressize;
                     if (_PyString_Resize(&res, requiredsize)) {
                         Py_DECREF(repunicode);
@@ -3731,7 +3754,7 @@ static PyObject *unicode_encode_ucs1(con
                 }
                 /* check if there is anything unencodable in the replacement
                    and copy it to the output */
-                for (uni2 = PyUnicode_AS_UNICODE(repunicode);repsize-->0; ++uni2, ++str) {
+                for (uni2 = PyUnicode_AS_UNICODE(repunicode); repsize-->0; ++uni2, ++str) {
                     c = *uni2;
                     if (c >= limit) {
                         raise_encode_exception(&exc, encoding, startp, size,
@@ -3747,14 +3770,18 @@ static PyObject *unicode_encode_ucs1(con
         }
     }
     /* Resize if we allocated to much */
-    respos = str-PyString_AS_STRING(res);
-    if (respos<ressize)
+    respos = str - PyString_AS_STRING(res);
+    if (respos < ressize)
         /* If this falls res will be NULL */
         _PyString_Resize(&res, respos);
     Py_XDECREF(errorHandler);
     Py_XDECREF(exc);
     return res;
 
+  overflow:
+    PyErr_SetString(PyExc_OverflowError,
+                    "encoded result is too long for a Python string");
+
   onError:
     Py_XDECREF(res);
     Py_XDECREF(errorHandler);

File Added: pkgsrc/lang/python27/patches/Attic/patch-Python_codecs.c
$NetBSD: patch-Python_codecs.c,v 1.1.2.2 2014/11/03 14:12:52 tron Exp $

taken from https://hg.python.org/cpython/rev/3f7519f633ed and
https://hg.python.org/cpython/rev/d1be1f355f59:

Issue #22518: Fixed integer overflow issues in "backslashreplace"
and "xmlcharrefreplace" error handlers.

--- Python/codecs.c.orig	2014-06-30 02:05:46.000000000 +0000
+++ Python/codecs.c
@@ -558,7 +558,7 @@ PyObject *PyCodec_XMLCharRefReplaceError
         Py_UNICODE *startp;
         Py_UNICODE *e;
         Py_UNICODE *outp;
-        int ressize;
+        Py_ssize_t ressize;
         if (PyUnicodeEncodeError_GetStart(exc, &start))
             return NULL;
         if (PyUnicodeEncodeError_GetEnd(exc, &end))
@@ -566,6 +566,13 @@ PyObject *PyCodec_XMLCharRefReplaceError
         if (!(object = PyUnicodeEncodeError_GetObject(exc)))
             return NULL;
         startp = PyUnicode_AS_UNICODE(object);
+        if (end - start > PY_SSIZE_T_MAX / (2+7+1)) {
+            end = start + PY_SSIZE_T_MAX / (2+7+1);
+#ifndef Py_UNICODE_WIDE
+            if (0xD800 <= startp[end - 1] && startp[end - 1] <= 0xDBFF)
+                end--;
+#endif
+        }
         e = startp + end;
         for (p = startp+start, ressize = 0; p < e;) {
             Py_UCS4 ch = *p++;
@@ -675,13 +682,15 @@ PyObject *PyCodec_BackslashReplaceErrors
         Py_UNICODE *p;
         Py_UNICODE *startp;
         Py_UNICODE *outp;
-        int ressize;
+        Py_ssize_t ressize;
         if (PyUnicodeEncodeError_GetStart(exc, &start))
             return NULL;
         if (PyUnicodeEncodeError_GetEnd(exc, &end))
             return NULL;
         if (!(object = PyUnicodeEncodeError_GetObject(exc)))
             return NULL;
+        if (end - start > PY_SSIZE_T_MAX / (1+1+8))
+            end = start + PY_SSIZE_T_MAX / (1+1+8);
         startp = PyUnicode_AS_UNICODE(object);
         for (p = startp+start, ressize = 0; p < startp+end; ++p) {
 #ifdef Py_UNICODE_WIDE

cvs diff -r1.2 -r1.2.20.1 pkgsrc/lang/python27/patches/Attic/patch-ab (expand / switch to unified diff)

--- pkgsrc/lang/python27/patches/Attic/patch-ab 2012/04/13 18:47:31 1.2
+++ pkgsrc/lang/python27/patches/Attic/patch-ab 2014/11/03 14:12:52 1.2.20.1
@@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
1$NetBSD: patch-ab,v 1.2 2012/04/13 18:47:31 adam Exp $ 1$NetBSD: patch-ab,v 1.2.20.1 2014/11/03 14:12:52 tron Exp $
2 2
3--- Lib/distutils/command/build_ext.py.orig 2010-04-01 18:17:09.000000000 +0000 3--- Lib/distutils/command/build_ext.py.orig 2014-06-30 02:05:25.000000000 +0000
4+++ Lib/distutils/command/build_ext.py 4+++ Lib/distutils/command/build_ext.py
5@@ -513,8 +513,19 @@ class build_ext (Command): 5@@ -511,8 +511,19 @@ class build_ext (Command):
6 # that go into the mix. 6 # that go into the mix.
7 if ext.extra_objects: 7 if ext.extra_objects:
8 objects.extend(ext.extra_objects) 8 objects.extend(ext.extra_objects)
9+ 9+
10+ # Two possible sources for extra linker arguments: 10+ # Two possible sources for extra linker arguments:
11+ # - 'extra_link_args' in Extension object 11+ # - 'extra_link_args' in Extension object
12+ # - LDFLAGS environment variable 12+ # - LDFLAGS environment variable
13+ # The environment variable should take precedence, and 13+ # The environment variable should take precedence, and
14+ # any sensible compiler will give precedence to later 14+ # any sensible compiler will give precedence to later
15+ # command line args. Hence we combine them in order: 15+ # command line args. Hence we combine them in order:
16 extra_args = ext.extra_link_args or [] 16 extra_args = ext.extra_link_args or []
17  17
18+ if os.environ.has_key('LDFLAGS'): 18+ if os.environ.has_key('LDFLAGS'):

cvs diff -r1.1.1.1 -r1.1.1.1.30.1 pkgsrc/lang/python27/patches/Attic/patch-ad (expand / switch to unified diff)

--- pkgsrc/lang/python27/patches/Attic/patch-ad 2011/02/22 08:52:01 1.1.1.1
+++ pkgsrc/lang/python27/patches/Attic/patch-ad 2014/11/03 14:12:52 1.1.1.1.30.1
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1$NetBSD: patch-ad,v 1.1.1.1 2011/02/22 08:52:01 obache Exp $ 1$NetBSD: patch-ad,v 1.1.1.1.30.1 2014/11/03 14:12:52 tron Exp $
2 2
3Add ability to parse unsigned integers as externalized by NetBSD proplib(3). 3Add ability to parse unsigned integers as externalized by NetBSD proplib(3).
4 4
5--- Lib/plistlib.py.orig 2010-04-20 20:59:37.000000000 +0000 5--- Lib/plistlib.py.orig 2014-06-30 02:05:30.000000000 +0000
6+++ Lib/plistlib.py 6+++ Lib/plistlib.py
7@@ -463,7 +463,7 @@ class PlistParser: 7@@ -463,7 +463,7 @@ class PlistParser:
8 def end_false(self): 8 def end_false(self):
9 self.addObject(False) 9 self.addObject(False)
10 def end_integer(self): 10 def end_integer(self):
11- self.addObject(int(self.getData())) 11- self.addObject(int(self.getData()))
12+ self.addObject(int(self.getData(), 0)) 12+ self.addObject(int(self.getData(), 0))
13 def end_real(self): 13 def end_real(self):
14 self.addObject(float(self.getData())) 14 self.addObject(float(self.getData()))
15 def end_string(self): 15 def end_string(self):

cvs diff -r1.1.1.1 -r1.1.1.1.30.1 pkgsrc/lang/python27/patches/Attic/patch-ae (expand / switch to unified diff)

--- pkgsrc/lang/python27/patches/Attic/patch-ae 2011/02/22 08:52:01 1.1.1.1
+++ pkgsrc/lang/python27/patches/Attic/patch-ae 2014/11/03 14:12:52 1.1.1.1.30.1
@@ -1,19 +1,19 @@ @@ -1,19 +1,19 @@
1$NetBSD: patch-ae,v 1.1.1.1 2011/02/22 08:52:01 obache Exp $ 1$NetBSD: patch-ae,v 1.1.1.1.30.1 2014/11/03 14:12:52 tron Exp $
2 2
3XXXbjs: I use amd64, and audioop is broken on 64-bit platforms. 3XXXbjs: I use amd64, and audioop is broken on 64-bit platforms.
4Thus, this needs to be tested. 4Thus, this needs to be tested.
5 5
6--- Modules/sunaudiodev.c.orig 2010-05-09 14:46:46.000000000 +0000 6--- Modules/sunaudiodev.c.orig 2014-06-30 02:05:44.000000000 +0000
7+++ Modules/sunaudiodev.c 7+++ Modules/sunaudiodev.c
8@@ -224,7 +224,11 @@ sad_ibufcount(sadobject *self) 8@@ -224,7 +224,11 @@ sad_ibufcount(sadobject *self)
9 { 9 {
10 audio_info_t ai; 10 audio_info_t ai;
11  11
12+#if defined(__NetBSD__) && defined(AUDIO_GETBUFINFO) 12+#if defined(__NetBSD__) && defined(AUDIO_GETBUFINFO)
13+ if (ioctl(self->x_fd, AUDIO_GEBUFTINFO, &ai) < 0) { 13+ if (ioctl(self->x_fd, AUDIO_GEBUFTINFO, &ai) < 0) {
14+#else 14+#else
15 if (ioctl(self->x_fd, AUDIO_GETINFO, &ai) < 0) { 15 if (ioctl(self->x_fd, AUDIO_GETINFO, &ai) < 0) {
16+#endif 16+#endif
17 PyErr_SetFromErrno(SunAudioError); 17 PyErr_SetFromErrno(SunAudioError);
18 return NULL; 18 return NULL;
19 } 19 }

cvs diff -r1.1.1.1 -r1.1.1.1.30.1 pkgsrc/lang/python27/patches/Attic/patch-an (expand / switch to unified diff)

--- pkgsrc/lang/python27/patches/Attic/patch-an 2011/02/22 08:52:01 1.1.1.1
+++ pkgsrc/lang/python27/patches/Attic/patch-an 2014/11/03 14:12:52 1.1.1.1.30.1
@@ -1,12 +1,12 @@ @@ -1,12 +1,12 @@
1$NetBSD: patch-an,v 1.1.1.1 2011/02/22 08:52:01 obache Exp $ 1$NetBSD: patch-an,v 1.1.1.1.30.1 2014/11/03 14:12:52 tron Exp $
2 2
3--- Modules/makesetup.orig 2007-09-05 11:47:34.000000000 +0000 3--- Modules/makesetup.orig 2014-06-30 02:05:43.000000000 +0000
4+++ Modules/makesetup 4+++ Modules/makesetup
5@@ -164,6 +164,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | 5@@ -164,6 +164,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
6 -rpath) libs="$libs $arg"; skip=libs;; 6 -rpath) libs="$libs $arg"; skip=libs;;
7 --rpath) libs="$libs $arg"; skip=libs;; 7 --rpath) libs="$libs $arg"; skip=libs;;
8 -[A-Zl]*) libs="$libs $arg";; 8 -[A-Zl]*) libs="$libs $arg";;
9+ -pthread) libs="$libs $arg";; 9+ -pthread) libs="$libs $arg";;
10 *.a) libs="$libs $arg";; 10 *.a) libs="$libs $arg";;
11 *.so) libs="$libs $arg";; 11 *.so) libs="$libs $arg";;
12 *.sl) libs="$libs $arg";; 12 *.sl) libs="$libs $arg";;

cvs diff -r1.1.1.1 -r1.1.1.1.30.1 pkgsrc/lang/python27/patches/Attic/patch-av (expand / switch to unified diff)

--- pkgsrc/lang/python27/patches/Attic/patch-av 2011/02/22 08:52:01 1.1.1.1
+++ pkgsrc/lang/python27/patches/Attic/patch-av 2014/11/03 14:12:52 1.1.1.1.30.1
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1$NetBSD: patch-av,v 1.1.1.1 2011/02/22 08:52:01 obache Exp $ 1$NetBSD: patch-av,v 1.1.1.1.30.1 2014/11/03 14:12:52 tron Exp $
2 2
3Add a knob (enviroment variable) for disabling installation of egg metadata 3Add a knob (enviroment variable) for disabling installation of egg metadata
4in extensions until we have infrastructure in place for dealing w/ it. 4in extensions until we have infrastructure in place for dealing w/ it.
5 5
6--- Lib/distutils/command/install.py.orig 2010-05-05 19:09:31.000000000 +0000 6--- Lib/distutils/command/install.py.orig 2014-06-30 02:05:25.000000000 +0000
7+++ Lib/distutils/command/install.py 7+++ Lib/distutils/command/install.py
8@@ -666,7 +666,8 @@ class install (Command): 8@@ -666,7 +666,8 @@ class install (Command):
9 ('install_headers', has_headers), 9 ('install_headers', has_headers),
10 ('install_scripts', has_scripts), 10 ('install_scripts', has_scripts),
11 ('install_data', has_data), 11 ('install_data', has_data),
12- ('install_egg_info', lambda self:True), 12- ('install_egg_info', lambda self:True),
13 ] 13 ]
14+ if not os.environ.has_key('PKGSRC_PYTHON_NO_EGG'): 14+ if not os.environ.has_key('PKGSRC_PYTHON_NO_EGG'):
15+ sub_commands += [('install_egg_info', lambda self:True),] 15+ sub_commands += [('install_egg_info', lambda self:True),]
16  16
17 # class install 17 # class install

cvs diff -r1.1.1.1 -r1.1.1.1.30.1 pkgsrc/lang/python27/patches/Attic/patch-aw (expand / switch to unified diff)

--- pkgsrc/lang/python27/patches/Attic/patch-aw 2011/02/22 08:52:01 1.1.1.1
+++ pkgsrc/lang/python27/patches/Attic/patch-aw 2014/11/03 14:12:52 1.1.1.1.30.1
@@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
1$NetBSD: patch-aw,v 1.1.1.1 2011/02/22 08:52:01 obache Exp $ 1$NetBSD: patch-aw,v 1.1.1.1.30.1 2014/11/03 14:12:52 tron Exp $
2 2
3--- Modules/nismodule.c.orig 2010-08-19 09:09:04.000000000 +0000 3--- Modules/nismodule.c.orig 2014-06-30 02:05:43.000000000 +0000
4+++ Modules/nismodule.c 4+++ Modules/nismodule.c
5@@ -89,7 +89,7 @@ nis_mapname (char *map, int *pfix) 5@@ -89,7 +89,7 @@ nis_mapname (char *map, int *pfix)
6 return map; 6 return map;
7 } 7 }
8  8
9-#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) 9-#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__)
10+#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) 10+#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
11 typedef int (*foreachfunc)(unsigned long, char *, int, char *, int, void *); 11 typedef int (*foreachfunc)(unsigned long, char *, int, char *, int, void *);
12 #else 12 #else
13 typedef int (*foreachfunc)(int, char *, int, char *, int, char *); 13 typedef int (*foreachfunc)(int, char *, int, char *, int, char *);

cvs diff -r1.2 -r1.2.12.1 pkgsrc/lang/python27/patches/Attic/patch-ah (expand / switch to unified diff)

--- pkgsrc/lang/python27/patches/Attic/patch-ah 2013/04/12 09:03:41 1.2
+++ pkgsrc/lang/python27/patches/Attic/patch-ah 2014/11/03 14:12:52 1.2.12.1
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1$NetBSD: patch-ah,v 1.2 2013/04/12 09:03:41 adam Exp $ 1$NetBSD: patch-ah,v 1.2.12.1 2014/11/03 14:12:52 tron Exp $
2 2
3--- Modules/_cursesmodule.c.orig 2013-04-06 14:02:36.000000000 +0000 3--- Modules/_cursesmodule.c.orig 2014-06-30 02:05:41.000000000 +0000
4+++ Modules/_cursesmodule.c 4+++ Modules/_cursesmodule.c
5@@ -322,17 +322,9 @@ Window_NoArg2TupleReturnFunction(getpary 5@@ -322,17 +322,9 @@ Window_NoArg2TupleReturnFunction(getpary
6  6
7 Window_OneArgNoReturnFunction(clearok, int, "i;True(1) or False(0)") 7 Window_OneArgNoReturnFunction(clearok, int, "i;True(1) or False(0)")
8 Window_OneArgNoReturnFunction(idlok, int, "i;True(1) or False(0)") 8 Window_OneArgNoReturnFunction(idlok, int, "i;True(1) or False(0)")
9-#if defined(__NetBSD__) 9-#if defined(__NetBSD__)
10-Window_OneArgNoReturnVoidFunction(keypad, int, "i;True(1) or False(0)") 10-Window_OneArgNoReturnVoidFunction(keypad, int, "i;True(1) or False(0)")
11-#else 11-#else
12 Window_OneArgNoReturnFunction(keypad, int, "i;True(1) or False(0)") 12 Window_OneArgNoReturnFunction(keypad, int, "i;True(1) or False(0)")
13-#endif 13-#endif
14 Window_OneArgNoReturnFunction(leaveok, int, "i;True(1) or False(0)") 14 Window_OneArgNoReturnFunction(leaveok, int, "i;True(1) or False(0)")
15-#if defined(__NetBSD__) 15-#if defined(__NetBSD__)
16-Window_OneArgNoReturnVoidFunction(nodelay, int, "i;True(1) or False(0)") 16-Window_OneArgNoReturnVoidFunction(nodelay, int, "i;True(1) or False(0)")

cvs diff -r1.2 -r1.2.12.1 pkgsrc/lang/python27/patches/patch-pyconfig.h.in (expand / switch to unified diff)

--- pkgsrc/lang/python27/patches/patch-pyconfig.h.in 2013/04/12 09:03:41 1.2
+++ pkgsrc/lang/python27/patches/patch-pyconfig.h.in 2014/11/03 14:12:52 1.2.12.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1$NetBSD: patch-pyconfig.h.in,v 1.2 2013/04/12 09:03:41 adam Exp $ 1$NetBSD: patch-pyconfig.h.in,v 1.2.12.1 2014/11/03 14:12:52 tron Exp $
2 2
3--- pyconfig.h.in.orig 2011-06-11 17:46:28.000000000 +0200 3--- pyconfig.h.in.orig 2014-06-30 02:05:48.000000000 +0000
4+++ pyconfig.h.in 2011-11-29 20:17:04.328552361 +0100 4+++ pyconfig.h.in
5@@ -1191,7 +1191,9 @@ 5@@ -1200,7 +1200,9 @@
6 #undef _UINT64_T 6 #undef _UINT64_T
7  7
8 /* Define to the level of X/Open that your system supports */ 8 /* Define to the level of X/Open that your system supports */
9+#if !defined(__sun) || (defined(__sun) && !defined(_XOPEN_SOURCE)) 9+#if !defined(__sun) || (defined(__sun) && !defined(_XOPEN_SOURCE))
10 #undef _XOPEN_SOURCE 10 #undef _XOPEN_SOURCE
11+#endif 11+#endif
12  12
13 /* Define to activate Unix95-and-earlier features */ 13 /* Define to activate Unix95-and-earlier features */
14 #undef _XOPEN_SOURCE_EXTENDED 14 #undef _XOPEN_SOURCE_EXTENDED

cvs diff -r1.17 -r1.17.4.1 pkgsrc/lang/python27/patches/Attic/patch-am (expand / switch to unified diff)

--- pkgsrc/lang/python27/patches/Attic/patch-am 2014/05/21 00:31:07 1.17
+++ pkgsrc/lang/python27/patches/Attic/patch-am 2014/11/03 14:12:52 1.17.4.1
@@ -1,39 +1,39 @@ @@ -1,39 +1,39 @@
1$NetBSD: patch-am,v 1.17 2014/05/21 00:31:07 obache Exp $ 1$NetBSD: patch-am,v 1.17.4.1 2014/11/03 14:12:52 tron Exp $
2 2
3Disabled modules for normal build: 3Disabled modules for normal build:
4bsddb 4bsddb
5curses 5curses
6curses_panel 6curses_panel
7elementtree 7elementtree
8sqlite3 8sqlite3
9tkinter 9tkinter
10gdbm 10gdbm
11pyexpat 11pyexpat
12readline 12readline
13{linux,oss,sun}audiodev 13{linux,oss,sun}audiodev
14spwd 14spwd
15Those have separate packages where needed. 15Those have separate packages where needed.
16 16
17Only check the BUILDLINK_DIR for libraries etc, do not pick up random 17Only check the BUILDLINK_DIR for libraries etc, do not pick up random
18headers and libraries from the system. 18headers and libraries from the system.
19 19
20Build the _ssl module with pkgsrc choiced OpenSSL. 20Build the _ssl module with pkgsrc choiced OpenSSL.
21 21
22Build the 1.85 compat module all the time against the BDB version of choice. 22Build the 1.85 compat module all the time against the BDB version of choice.
23 23
24cygwin 2.7.3-no-libm.patch 24cygwin 2.7.3-no-libm.patch
25 25
26--- setup.py.orig 2013-11-10 07:36:41.000000000 +0000 26--- setup.py.orig 2014-06-30 02:05:48.000000000 +0000
27+++ setup.py 27+++ setup.py
28@@ -33,7 +33,7 @@ host_platform = get_platform() 28@@ -33,7 +33,7 @@ host_platform = get_platform()
29 COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS")) 29 COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
30  30
31 # This global variable is used to hold the list of modules to be disabled. 31 # This global variable is used to hold the list of modules to be disabled.
32-disabled_module_list = [] 32-disabled_module_list = []
33+disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree", "_sqlite3", "_tkinter", "gdbm", "pyexpat", "readline", "linuxaudiodev", "ossaudiodev", "spwd", "sunaudiodev"] 33+disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_elementtree", "_sqlite3", "_tkinter", "gdbm", "pyexpat", "readline", "linuxaudiodev", "ossaudiodev", "spwd", "sunaudiodev"]
34  34
35 def add_dir_to_list(dirlist, dir): 35 def add_dir_to_list(dirlist, dir):
36 """Add the directory 'dir' to the list 'dirlist' (at the front) if 36 """Add the directory 'dir' to the list 'dirlist' (at the front) if
37@@ -436,10 +436,15 @@ class PyBuildExt(build_ext): 37@@ -436,10 +436,15 @@ class PyBuildExt(build_ext):
38 os.unlink(tmpfile) 38 os.unlink(tmpfile)
39  39
@@ -53,62 +53,62 @@ cygwin 2.7.3-no-libm.patch @@ -53,62 +53,62 @@ cygwin 2.7.3-no-libm.patch
53+ self.compiler.include_dirs.insert(0, incdir) 53+ self.compiler.include_dirs.insert(0, incdir)
54 if cross_compiling: 54 if cross_compiling:
55 self.add_gcc_paths() 55 self.add_gcc_paths()
56 self.add_multiarch_paths() 56 self.add_multiarch_paths()
57@@ -551,7 +556,7 @@ class PyBuildExt(build_ext): 57@@ -551,7 +556,7 @@ class PyBuildExt(build_ext):
58  58
59 # Check for MacOS X, which doesn't need libm.a at all 59 # Check for MacOS X, which doesn't need libm.a at all
60 math_libs = ['m'] 60 math_libs = ['m']
61- if host_platform in ['darwin', 'beos']: 61- if host_platform in ['darwin', 'beos']:
62+ if host_platform in ['darwin', 'beos', 'cygwin']: 62+ if host_platform in ['darwin', 'beos', 'cygwin']:
63 math_libs = [] 63 math_libs = []
64  64
65 # XXX Omitted modules: gl, pure, dl, SGI-specific modules 65 # XXX Omitted modules: gl, pure, dl, SGI-specific modules
66@@ -785,11 +790,10 @@ class PyBuildExt(build_ext): 66@@ -787,11 +792,10 @@ class PyBuildExt(build_ext):
67 libraries=math_libs) ) 67 libraries=math_libs) )
68 # Detect SSL support for the socket module (via _ssl) 68 # Detect SSL support for the socket module (via _ssl)
69 search_for_ssl_incs_in = [ 69 search_for_ssl_incs_in = [
70- '/usr/local/ssl/include', 70- '/usr/local/ssl/include',
71- '/usr/contrib/ssl/include/' 71- '/usr/contrib/ssl/include/'
72+ '@SSLBASE@/include' 72+ '@SSLBASE@/include'
73 ] 73 ]
74- ssl_incs = find_file('openssl/ssl.h', inc_dirs, 74- ssl_incs = find_file('openssl/ssl.h', inc_dirs,
75- search_for_ssl_incs_in 75- search_for_ssl_incs_in
76+ ssl_incs = find_file('openssl/ssl.h', [], 76+ ssl_incs = find_file('openssl/ssl.h', [],
77+ search_for_ssl_incs_in + inc_dirs 77+ search_for_ssl_incs_in + inc_dirs
78 ) 78 )
79 if ssl_incs is not None: 79 if ssl_incs is not None:
80 krb5_h = find_file('krb5.h', inc_dirs, 80 krb5_h = find_file('krb5.h', inc_dirs,
81@@ -797,9 +801,7 @@ class PyBuildExt(build_ext): 81@@ -799,9 +803,7 @@ class PyBuildExt(build_ext):
82 if krb5_h: 82 if krb5_h:
83 ssl_incs += krb5_h 83 ssl_incs += krb5_h
84 ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, 84 ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
85- ['/usr/local/ssl/lib', 85- ['/usr/local/ssl/lib',
86- '/usr/contrib/ssl/lib/' 86- '/usr/contrib/ssl/lib/'
87- ] ) 87- ] )
88+ [] ) 88+ [] )
89  89
90 if (ssl_incs is not None and 90 if (ssl_incs is not None and
91 ssl_libs is not None): 91 ssl_libs is not None):
92@@ -818,7 +820,7 @@ class PyBuildExt(build_ext): 92@@ -820,7 +822,7 @@ class PyBuildExt(build_ext):
93  93
94 # look for the openssl version header on the compiler search path. 94 # look for the openssl version header on the compiler search path.
95 opensslv_h = find_file('openssl/opensslv.h', [], 95 opensslv_h = find_file('openssl/opensslv.h', [],
96- inc_dirs + search_for_ssl_incs_in) 96- inc_dirs + search_for_ssl_incs_in)
97+ search_for_ssl_incs_in + inc_dirs) 97+ search_for_ssl_incs_in + inc_dirs)
98 if opensslv_h: 98 if opensslv_h:
99 name = os.path.join(opensslv_h[0], 'openssl/opensslv.h') 99 name = os.path.join(opensslv_h[0], 'openssl/opensslv.h')
100 if host_platform == 'darwin' and is_macosx_sdk_path(name): 100 if host_platform == 'darwin' and is_macosx_sdk_path(name):
101@@ -918,175 +920,6 @@ class PyBuildExt(build_ext): 101@@ -920,175 +922,6 @@ class PyBuildExt(build_ext):
102 else: 102 else:
103 raise ValueError("unknown major BerkeleyDB version", major) 103 raise ValueError("unknown major BerkeleyDB version", major)
104  104
105- # construct a list of paths to look for the header file in on 105- # construct a list of paths to look for the header file in on
106- # top of the normal inc_dirs. 106- # top of the normal inc_dirs.
107- db_inc_paths = [ 107- db_inc_paths = [
108- '/usr/include/db4', 108- '/usr/include/db4',
109- '/usr/local/include/db4', 109- '/usr/local/include/db4',
110- '/opt/sfw/include/db4', 110- '/opt/sfw/include/db4',
111- '/usr/include/db3', 111- '/usr/include/db3',
112- '/usr/local/include/db3', 112- '/usr/local/include/db3',
113- '/opt/sfw/include/db3', 113- '/opt/sfw/include/db3',
114- # Fink defaults (http://fink.sourceforge.net/) 114- # Fink defaults (http://fink.sourceforge.net/)
@@ -264,27 +264,27 @@ cygwin 2.7.3-no-libm.patch @@ -264,27 +264,27 @@ cygwin 2.7.3-no-libm.patch
264- runtime_library_dirs=dblib_dir, 264- runtime_library_dirs=dblib_dir,
265- include_dirs=db_incs, 265- include_dirs=db_incs,
266- libraries=dblibs)) 266- libraries=dblibs))
267- else: 267- else:
268- if db_setup_debug: print "db: no appropriate library found" 268- if db_setup_debug: print "db: no appropriate library found"
269- db_incs = None 269- db_incs = None
270- dblibs = [] 270- dblibs = []
271- dblib_dir = None 271- dblib_dir = None
272- missing.append('_bsddb') 272- missing.append('_bsddb')
273- 273-
274 # The sqlite interface 274 # The sqlite interface
275 sqlite_setup_debug = False # verbose debug prints from this script? 275 sqlite_setup_debug = False # verbose debug prints from this script?
276  276
277@@ -1204,35 +1037,39 @@ class PyBuildExt(build_ext): 277@@ -1205,35 +1038,39 @@ class PyBuildExt(build_ext):
278 # we do not build this one. Otherwise this build will pick up 278 # we do not build this one. Otherwise this build will pick up
279 # the more recent berkeleydb's db.h file first in the include path 279 # the more recent berkeleydb's db.h file first in the include path
280 # when attempting to compile and it will fail. 280 # when attempting to compile and it will fail.
281- f = "/usr/include/db.h" 281- f = "/usr/include/db.h"
282- 282-
283- if host_platform == 'darwin': 283- if host_platform == 'darwin':
284- if is_macosx_sdk_path(f): 284- if is_macosx_sdk_path(f):
285- sysroot = macosx_sdk_root() 285- sysroot = macosx_sdk_root()
286- f = os.path.join(sysroot, f[1:]) 286- f = os.path.join(sysroot, f[1:])
287- 287-
288- if os.path.exists(f) and not db_incs: 288- if os.path.exists(f) and not db_incs:
289- data = open(f).read() 289- data = open(f).read()
290- m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) 290- m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
@@ -328,62 +328,62 @@ cygwin 2.7.3-no-libm.patch @@ -328,62 +328,62 @@ cygwin 2.7.3-no-libm.patch
328+ while 1: 328+ while 1:
329+ line = input.readline() 329+ line = input.readline()
330+ if not line: break 330+ if not line: break
331+ if re.search('This file is part of GDBM', line): 331+ if re.search('This file is part of GDBM', line):
332+ ret = None 332+ ret = None
333+ break 333+ break
334+ input.close() 334+ input.close()
335+ break 335+ break
336+ return ret 336+ return ret
337+ 337+
338 config_args = [arg.strip("'") 338 config_args = [arg.strip("'")
339 for arg in sysconfig.get_config_var("CONFIG_ARGS").split()] 339 for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
340 dbm_args = [arg for arg in config_args 340 dbm_args = [arg for arg in config_args
341@@ -1244,7 +1081,7 @@ class PyBuildExt(build_ext): 341@@ -1245,7 +1082,7 @@ class PyBuildExt(build_ext):
342 dbmext = None 342 dbmext = None
343 for cand in dbm_order: 343 for cand in dbm_order:
344 if cand == "ndbm": 344 if cand == "ndbm":
345- if find_file("ndbm.h", inc_dirs, []) is not None: 345- if find_file("ndbm.h", inc_dirs, []) is not None:
346+ if find_ndbm_h(inc_dirs) is not None: 346+ if find_ndbm_h(inc_dirs) is not None:
347 # Some systems have -lndbm, others have -lgdbm_compat, 347 # Some systems have -lndbm, others have -lgdbm_compat,
348 # others don't have either 348 # others don't have either
349 if self.compiler.find_library_file(lib_dirs, 349 if self.compiler.find_library_file(lib_dirs,
350@@ -1288,18 +1125,14 @@ class PyBuildExt(build_ext): 350@@ -1289,18 +1126,14 @@ class PyBuildExt(build_ext):
351 libraries = gdbm_libs) 351 libraries = gdbm_libs)
352 break 352 break
353 elif cand == "bdb": 353 elif cand == "bdb":
354- if db_incs is not None: 354- if db_incs is not None:
355- print "building dbm using bdb" 355- print "building dbm using bdb"
356- dbmext = Extension('dbm', ['dbmmodule.c'], 356- dbmext = Extension('dbm', ['dbmmodule.c'],
357- library_dirs=dblib_dir, 357- library_dirs=dblib_dir,
358- runtime_library_dirs=dblib_dir, 358- runtime_library_dirs=dblib_dir,
359- include_dirs=db_incs, 359- include_dirs=db_incs,
360- define_macros=[ 360- define_macros=[
361- ('HAVE_BERKDB_H', None), 361- ('HAVE_BERKDB_H', None),
362- ('DB_DBM_HSEARCH', None), 362- ('DB_DBM_HSEARCH', None),
363- ], 363- ],
364- libraries=dblibs) 364- libraries=dblibs)
365- break 365- break
366+ print "building dbm using bdb" 366+ print "building dbm using bdb"
367+ dbmext = Extension('dbm', ['dbmmodule.c'], 367+ dbmext = Extension('dbm', ['dbmmodule.c'],
368+ define_macros=[ 368+ define_macros=[
369+ ('HAVE_BERKDB_H', None), 369+ ('HAVE_BERKDB_H', None),
370+ ('DB_DBM_HSEARCH', None), 370+ ('DB_DBM_HSEARCH', None),
371+ ], 371+ ],
372+ libraries=["db"]) 372+ libraries=["db"])
373+ break 373+ break
374 if dbmext is not None: 374 if dbmext is not None:
375 exts.append(dbmext) 375 exts.append(dbmext)
376 else: 376 else:
377@@ -2222,9 +2055,9 @@ def main(): 377@@ -2228,9 +2061,9 @@ def main():
378 ext_modules=[Extension('_struct', ['_struct.c'])], 378 ext_modules=[Extension('_struct', ['_struct.c'])],
379  379
380 # Scripts to install 380 # Scripts to install
381- scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle', 381- scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
382- 'Tools/scripts/2to3', 382- 'Tools/scripts/2to3',
383- 'Lib/smtpd.py'] 383- 'Lib/smtpd.py']
384+ scripts = ['Tools/scripts/pydoc2.7', 384+ scripts = ['Tools/scripts/pydoc2.7',
385+ 'Tools/scripts/2to3-2.7', 385+ 'Tools/scripts/2to3-2.7',
386+ 'Tools/scripts/smtpd2.7.py'] 386+ 'Tools/scripts/smtpd2.7.py']
387 ) 387 )
388  388
389 # --install-platlib 389 # --install-platlib

cvs diff -r1.4 -r1.4.12.1 pkgsrc/lang/python27/patches/Attic/patch-ao (expand / switch to unified diff)

--- pkgsrc/lang/python27/patches/Attic/patch-ao 2013/04/12 09:03:41 1.4
+++ pkgsrc/lang/python27/patches/Attic/patch-ao 2014/11/03 14:12:52 1.4.12.1
@@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
1$NetBSD: patch-ao,v 1.4 2013/04/12 09:03:41 adam Exp $ 1$NetBSD: patch-ao,v 1.4.12.1 2014/11/03 14:12:52 tron Exp $
2 2
3--- Lib/distutils/util.py.orig 2013-04-06 14:02:26.000000000 +0000 3--- Lib/distutils/util.py.orig 2014-06-30 02:05:26.000000000 +0000
4+++ Lib/distutils/util.py 4+++ Lib/distutils/util.py
5@@ -101,6 +101,8 @@ def get_platform (): 5@@ -101,6 +101,8 @@ def get_platform ():
6 osname, release, machine = _osx_support.get_platform_osx( 6 osname, release, machine = _osx_support.get_platform_osx(
7 distutils.sysconfig.get_config_vars(), 7 distutils.sysconfig.get_config_vars(),
8 osname, release, machine) 8 osname, release, machine)
9+ elif osname[:9] == "dragonfly": 9+ elif osname[:9] == "dragonfly":
10+ release = str.split(release, "-")[0] 10+ release = str.split(release, "-")[0]
11  11
12 return "%s-%s-%s" % (osname, release, machine) 12 return "%s-%s-%s" % (osname, release, machine)
13  13

cvs diff -r1.4 -r1.4.12.1 pkgsrc/lang/python27/patches/Attic/patch-ax (expand / switch to unified diff)

--- pkgsrc/lang/python27/patches/Attic/patch-ax 2013/04/12 09:03:41 1.4
+++ pkgsrc/lang/python27/patches/Attic/patch-ax 2014/11/03 14:12:52 1.4.12.1
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1$NetBSD: patch-ax,v 1.4 2013/04/12 09:03:41 adam Exp $ 1$NetBSD: patch-ax,v 1.4.12.1 2014/11/03 14:12:52 tron Exp $
2 2
3chop "-RELEASE" or "-DEVELOPMENT" from release for DragonFly. 3chop "-RELEASE" or "-DEVELOPMENT" from release for DragonFly.
4 4
5--- Lib/sysconfig.py.orig 2013-04-06 14:02:29.000000000 +0000 5--- Lib/sysconfig.py.orig 2014-06-30 02:05:31.000000000 +0000
6+++ Lib/sysconfig.py 6+++ Lib/sysconfig.py
7@@ -559,6 +559,8 @@ def get_platform(): 7@@ -603,6 +603,8 @@ def get_platform():
8 osname, release, machine = _osx_support.get_platform_osx( 8 osname, release, machine = _osx_support.get_platform_osx(
9 get_config_vars(), 9 get_config_vars(),
10 osname, release, machine) 10 osname, release, machine)
11+ elif osname[:9] == "dragonfly": 11+ elif osname[:9] == "dragonfly":
12+ release = str.split(release, '-')[0] 12+ release = str.split(release, '-')[0]
13  13
14 return "%s-%s-%s" % (osname, release, machine) 14 return "%s-%s-%s" % (osname, release, machine)
15  15

cvs diff -r1.6 -r1.6.12.1 pkgsrc/lang/python27/patches/Attic/patch-au (expand / switch to unified diff)

--- pkgsrc/lang/python27/patches/Attic/patch-au 2013/04/12 09:03:41 1.6
+++ pkgsrc/lang/python27/patches/Attic/patch-au 2014/11/03 14:12:52 1.6.12.1
@@ -1,27 +1,27 @@ @@ -1,27 +1,27 @@
1$NetBSD: patch-au,v 1.6 2013/04/12 09:03:41 adam Exp $ 1$NetBSD: patch-au,v 1.6.12.1 2014/11/03 14:12:52 tron Exp $
2 2
3Fix for unpriviliged build. 3Fix for unpriviliged build.
4 4
5http://hg.python.org/cpython/rev/a0f43f4481e0 5http://hg.python.org/cpython/rev/a0f43f4481e0
6 6
7--- Makefile.pre.in.orig 2013-04-06 14:02:34.000000000 +0000 7--- Makefile.pre.in.orig 2014-06-30 02:05:39.000000000 +0000
8+++ Makefile.pre.in 8+++ Makefile.pre.in
9@@ -489,7 +489,7 @@ gdbhooks: $(BUILDPYTHON)-gdb.py 9@@ -499,7 +499,7 @@ gdbhooks: $(BUILDPYTHON)-gdb.py
10  10
11 SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py 11 SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py
12 $(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS) 12 $(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS)
13- $(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py 13- $(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py
14+ cp $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py 14+ cp $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py
15  15
16 # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary 16 # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
17 # minimal framework (not including the Lib directory and such) in the current 17 # minimal framework (not including the Lib directory and such) in the current
18@@ -879,7 +879,8 @@ altbininstall: $(BUILDPYTHON) 18@@ -890,7 +890,8 @@ altbininstall: $(BUILDPYTHON)
19 (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \ 19 (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \
20 fi \ 20 fi \
21 fi; \ 21 fi; \
22- else true; \ 22- else true; \
23+ elif test -f $(INSTSONAME); then \ 23+ elif test -f $(INSTSONAME); then \
24+ $(INSTALL_SHARED) $(INSTSONAME) $(DESTDIR)$(LIBDIR); \ 24+ $(INSTALL_SHARED) $(INSTSONAME) $(DESTDIR)$(LIBDIR); \
25 fi 25 fi
26  26
27 # Install the versioned manual page 27 # Install the versioned manual page

cvs diff -r1.3 -r1.3.12.1 pkgsrc/lang/python27/patches/Attic/patch-az (expand / switch to unified diff)

--- pkgsrc/lang/python27/patches/Attic/patch-az 2013/04/12 09:03:41 1.3
+++ pkgsrc/lang/python27/patches/Attic/patch-az 2014/11/03 14:12:52 1.3.12.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1$NetBSD: patch-az,v 1.3 2013/04/12 09:03:41 adam Exp $ 1$NetBSD: patch-az,v 1.3.12.1 2014/11/03 14:12:52 tron Exp $
2 2
3--- Modules/selectmodule.c.orig Mon Jul 25 08:09:14 2011 3--- Modules/selectmodule.c.orig 2014-06-30 02:05:43.000000000 +0000
4+++ Modules/selectmodule.c 4+++ Modules/selectmodule.c
5@@ -1856,7 +1856,9 @@ initselect(void) 5@@ -1906,7 +1906,9 @@ initselect(void)
6 PyModule_AddIntConstant(m, "KQ_FILTER_NETDEV", EVFILT_NETDEV); 6 PyModule_AddIntConstant(m, "KQ_FILTER_NETDEV", EVFILT_NETDEV);
7 #endif 7 #endif
8 PyModule_AddIntConstant(m, "KQ_FILTER_SIGNAL", EVFILT_SIGNAL); 8 PyModule_AddIntConstant(m, "KQ_FILTER_SIGNAL", EVFILT_SIGNAL);
9+#ifdef EVFILT_TIMER 9+#ifdef EVFILT_TIMER
10 PyModule_AddIntConstant(m, "KQ_FILTER_TIMER", EVFILT_TIMER); 10 PyModule_AddIntConstant(m, "KQ_FILTER_TIMER", EVFILT_TIMER);
11+#endif 11+#endif
12  12
13 /* event flags */ 13 /* event flags */
14 PyModule_AddIntConstant(m, "KQ_EV_ADD", EV_ADD); 14 PyModule_AddIntConstant(m, "KQ_EV_ADD", EV_ADD);

cvs diff -r1.1 -r1.1.18.1 pkgsrc/lang/python27/patches/Attic/patch-xa (expand / switch to unified diff)

--- pkgsrc/lang/python27/patches/Attic/patch-xa 2012/08/14 18:19:02 1.1
+++ pkgsrc/lang/python27/patches/Attic/patch-xa 2014/11/03 14:12:52 1.1.18.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1$NetBSD: patch-xa,v 1.1 2012/08/14 18:19:02 drochner Exp $ 1$NetBSD: patch-xa,v 1.1.18.1 2014/11/03 14:12:52 tron Exp $
2 2
3--- Python/thread_pthread.h.orig 2012-03-30 13:06:51.000000000 +0000 3--- Python/thread_pthread.h.orig 2014-06-30 02:05:47.000000000 +0000
4+++ Python/thread_pthread.h 4+++ Python/thread_pthread.h
5@@ -34,6 +34,9 @@ 5@@ -46,6 +46,9 @@
6 we need to add 0 to make it work there as well. */ 6 we need to add 0 to make it work there as well. */
7 #if (_POSIX_SEMAPHORES+0) == -1 7 #if (_POSIX_SEMAPHORES+0) == -1
8 #define HAVE_BROKEN_POSIX_SEMAPHORES 8 #define HAVE_BROKEN_POSIX_SEMAPHORES
9+#elif defined(__NetBSD__) 9+#elif defined(__NetBSD__)
10+/* XXX accesses to closed file descriptors, needs debugging */ 10+/* XXX accesses to closed file descriptors, needs debugging */
11+#define HAVE_BROKEN_POSIX_SEMAPHORES 11+#define HAVE_BROKEN_POSIX_SEMAPHORES
12 #else 12 #else
13 #include <semaphore.h> 13 #include <semaphore.h>
14 #include <errno.h> 14 #include <errno.h>