]> git.pld-linux.org Git - packages/python.git/blob - python-install_prefix.patch
pclean *.patch
[packages/python.git] / python-install_prefix.patch
1 --- Python-2.7.6.orig/Lib/distutils/command/install.py  2015-11-22 14:29:00.153420762 +0100
2 +++ Python-2.7.6/Lib/distutils/command/install.py       2015-11-22 14:28:19.000000000 +0100
3 @@ -13,6 +13,8 @@
4  from distutils.core import Command
5  from distutils.debug import DEBUG
6  from distutils.sysconfig import get_config_vars
7 +from distutils.sysconfig import PREFIX, EXEC_PREFIX
8 +from distutils.sysconfig import SYS_PREFIX, SYS_EXEC_PREFIX
9  from distutils.errors import DistutilsPlatformError
10  from distutils.file_util import write_file
11  from distutils.util import convert_path, subst_vars, change_root
12 @@ -306,9 +308,9 @@
13                              'py_version': py_version,
14                              'py_version_short': py_version[0:3],
15                              'py_version_nodot': py_version[0] + py_version[2],
16 -                            'sys_prefix': prefix,
17 +                            'sys_prefix': SYS_PREFIX,
18                              'prefix': prefix,
19 -                            'sys_exec_prefix': exec_prefix,
20 +                            'sys_exec_prefix': SYS_EXEC_PREFIX,
21                              'exec_prefix': exec_prefix,
22                              'userbase': self.install_userbase,
23                              'usersite': self.install_usersite,
24 @@ -428,8 +430,8 @@
25                      raise DistutilsOptionError, \
26                            "must not supply exec-prefix without prefix"
27  
28 -                self.prefix = os.path.normpath(sys.prefix)
29 -                self.exec_prefix = os.path.normpath(sys.exec_prefix)
30 +                self.prefix = PREFIX
31 +                self.exec_prefix = EXEC_PREFIX
32  
33              else:
34                  if self.exec_prefix is None:
35 --- Python-2.7.6.orig/Lib/distutils/sysconfig.py        2015-11-22 14:29:00.153420762 +0100
36 +++ Python-2.7.6/Lib/distutils/sysconfig.py     2015-11-22 13:49:06.000000000 +0100
37 @@ -19,8 +19,10 @@
38  from distutils.errors import DistutilsPlatformError
39  
40  # These are needed in a couple of spots, so just compute them once.
41 -PREFIX = os.path.normpath(sys.prefix)
42 -EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
43 +SYS_PREFIX = os.path.normpath(sys.prefix)
44 +SYS_EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
45 +PREFIX = "/usr/local" if SYS_PREFIX == "/usr" else SYS_PREFIX
46 +EXEC_PREFIX = "/usr/local" if SYS_EXEC_PREFIX == "/usr" else SYS_EXEC_PREFIX
47  
48  # Path to the base directory of the project. On Windows the binary may
49  # live in project/PCBuild9.  If we're dealing with an x64 Windows build,
50 @@ -75,7 +77,7 @@
51      sys.exec_prefix -- i.e., ignore 'plat_specific'.
52      """
53      if prefix is None:
54 -        prefix = plat_specific and EXEC_PREFIX or PREFIX
55 +        prefix = plat_specific and SYS_EXEC_PREFIX or SYS_PREFIX
56  
57      if os.name == "posix":
58          if python_build:
59 @@ -116,7 +118,10 @@
60      sys.exec_prefix -- i.e., ignore 'plat_specific'.
61      """
62      if prefix is None:
63 -        prefix = plat_specific and EXEC_PREFIX or PREFIX
64 +        if standard_lib:
65 +            prefix = plat_specific and SYS_EXEC_PREFIX or SYS_PREFIX
66 +        else:
67 +            prefix = plat_specific and EXEC_PREFIX or PREFIX
68  
69      if os.name == "posix":
70          if plat_specific: 
71 --- Python-2.7.6.orig/Lib/site.py       2015-11-22 14:29:00.153420762 +0100
72 +++ Python-2.7.6/Lib/site.py    2015-11-22 13:40:03.000000000 +0100
73 @@ -64,7 +64,7 @@
74  import traceback
75  
76  # Prefixes for site-packages; add additional prefixes like /usr/local here
77 -PREFIXES = [sys.prefix, sys.exec_prefix]
78 +PREFIXES = ["/usr/local", sys.prefix, sys.exec_prefix]
79  # Enable per user site-packages directory
80  # set it to False to disable the feature or True to force the feature
81  ENABLE_USER_SITE = None
This page took 0.091828 seconds and 3 git commands to generate.