Update python to 2.5.4 (#4408)
[openwrt/svn-archive/archive.git] / lang / python / patches / 010-disable_modules_and_ssl.patch
1 Index: Python-2.5.1/setup.py
2 ===================================================================
3 --- Python-2.5.1.orig/setup.py 2007-07-30 12:55:24.000000000 -0500
4 +++ Python-2.5.1/setup.py 2007-07-30 12:55:24.000000000 -0500
5 @@ -15,7 +15,14 @@
6 from distutils.command.install_lib import install_lib
7
8 # This global variable is used to hold the list of modules to be disabled.
9 -disabled_module_list = []
10 +try:
11 + disabled_module_list = os.environ["PYTHON_DISABLE_MODULES"].split()
12 +except KeyError:
13 + disabled_module_list = []
14 +try:
15 + disable_ssl = os.environ["PYTHON_DISABLE_SSL"]
16 +except KeyError:
17 + disable_ssl = 0
18
19 def add_dir_to_list(dirlist, dir):
20 """Add the directory 'dir' to the list 'dirlist' (at the front) if
21 @@ -244,6 +251,7 @@
22 return sys.platform
23
24 def detect_modules(self):
25 + global disable_ssl
26 try:
27 modules_include_dirs = os.environ["PYTHON_MODULES_INCLUDE"].split()
28 except KeyError:
29 @@ -538,7 +546,8 @@
30 ] )
31
32 if (ssl_incs is not None and
33 - ssl_libs is not None):
34 + ssl_libs is not None and
35 + not disable_ssl):
36 exts.append( Extension('_ssl', ['_ssl.c'],
37 include_dirs = ssl_incs,
38 library_dirs = ssl_libs,