python-disable_modules_and_ssl.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. --- python.old/setup.py 2003-11-01 19:23:48.495647848 +0000
  2. +++ python/setup.py 2003-11-01 19:24:16.044459792 +0000
  3. @@ -15,7 +15,14 @@
  4. from distutils.command.install_lib import install_lib
  5. # This global variable is used to hold the list of modules to be disabled.
  6. -disabled_module_list = []
  7. +try:
  8. + disabled_module_list = os.environ["PYTHON_DISABLE_MODULES"].split()
  9. +except KeyError:
  10. + disabled_module_list = []
  11. +try:
  12. + disable_ssl = os.environ["PYTHON_DISABLE_SSL"]
  13. +except KeyError:
  14. + disable_ssl = 0
  15. def add_dir_to_list(dirlist, dir):
  16. """Add the directory 'dir' to the list 'dirlist' (at the front) if
  17. @@ -240,6 +247,7 @@
  18. return sys.platform
  19. def detect_modules(self):
  20. + global disable_ssl
  21. # Ensure that /usr/local is always used
  22. add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
  23. add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
  24. @@ -451,7 +459,8 @@
  25. ] )
  26. if (ssl_incs is not None and
  27. - ssl_libs is not None):
  28. + ssl_libs is not None and
  29. + not disable_ssl):
  30. exts.append( Extension('_ssl', ['_ssl.c'],
  31. include_dirs = ssl_incs,
  32. library_dirs = ssl_libs,