]>
Commit | Line | Data |
---|---|---|
4d51998b JR |
1 | diff -urNp -x '*.orig' Python-2.7.18.org/Lib/distutils/command/install.py Python-2.7.18/Lib/distutils/command/install.py |
2 | --- Python-2.7.18.org/Lib/distutils/command/install.py 2021-09-26 12:34:36.324550580 +0200 | |
3 | +++ Python-2.7.18/Lib/distutils/command/install.py 2021-09-26 12:34:37.124559456 +0200 | |
4 | @@ -13,6 +13,8 @@ from types import * | |
0fc165ca JK |
5 | from distutils.core import Command |
6 | from distutils.debug import DEBUG | |
7 | from distutils.sysconfig import get_config_vars | |
8 | +from distutils.sysconfig import PREFIX, EXEC_PREFIX | |
9 | +from distutils.sysconfig import SYS_PREFIX, SYS_EXEC_PREFIX | |
10 | from distutils.errors import DistutilsPlatformError | |
11 | from distutils.file_util import write_file | |
12 | from distutils.util import convert_path, subst_vars, change_root | |
4d51998b | 13 | @@ -306,9 +308,9 @@ class install (Command): |
0fc165ca JK |
14 | 'py_version': py_version, |
15 | 'py_version_short': py_version[0:3], | |
16 | 'py_version_nodot': py_version[0] + py_version[2], | |
17 | - 'sys_prefix': prefix, | |
18 | + 'sys_prefix': SYS_PREFIX, | |
19 | 'prefix': prefix, | |
20 | - 'sys_exec_prefix': exec_prefix, | |
21 | + 'sys_exec_prefix': SYS_EXEC_PREFIX, | |
22 | 'exec_prefix': exec_prefix, | |
23 | 'userbase': self.install_userbase, | |
24 | 'usersite': self.install_usersite, | |
4d51998b | 25 | @@ -428,8 +430,8 @@ class install (Command): |
0fc165ca JK |
26 | raise DistutilsOptionError, \ |
27 | "must not supply exec-prefix without prefix" | |
28 | ||
29 | - self.prefix = os.path.normpath(sys.prefix) | |
30 | - self.exec_prefix = os.path.normpath(sys.exec_prefix) | |
31 | + self.prefix = PREFIX | |
32 | + self.exec_prefix = EXEC_PREFIX | |
33 | ||
34 | else: | |
35 | if self.exec_prefix is None: | |
4d51998b JR |
36 | diff -urNp -x '*.orig' Python-2.7.18.org/Lib/distutils/sysconfig.py Python-2.7.18/Lib/distutils/sysconfig.py |
37 | --- Python-2.7.18.org/Lib/distutils/sysconfig.py 2021-09-26 12:34:36.324550580 +0200 | |
38 | +++ Python-2.7.18/Lib/distutils/sysconfig.py 2021-09-26 12:34:37.124559456 +0200 | |
39 | @@ -19,8 +19,10 @@ import sys | |
0fc165ca JK |
40 | from distutils.errors import DistutilsPlatformError |
41 | ||
42 | # These are needed in a couple of spots, so just compute them once. | |
43 | -PREFIX = os.path.normpath(sys.prefix) | |
44 | -EXEC_PREFIX = os.path.normpath(sys.exec_prefix) | |
45 | +SYS_PREFIX = os.path.normpath(sys.prefix) | |
46 | +SYS_EXEC_PREFIX = os.path.normpath(sys.exec_prefix) | |
7111e30b JK |
47 | +PREFIX = "/usr/local" if SYS_PREFIX == "/usr" else SYS_PREFIX |
48 | +EXEC_PREFIX = "/usr/local" if SYS_EXEC_PREFIX == "/usr" else SYS_EXEC_PREFIX | |
0fc165ca JK |
49 | |
50 | # Path to the base directory of the project. On Windows the binary may | |
51 | # live in project/PCBuild9. If we're dealing with an x64 Windows build, | |
4d51998b | 52 | @@ -80,7 +82,7 @@ def get_python_inc(plat_specific=0, pref |
0fc165ca JK |
53 | sys.exec_prefix -- i.e., ignore 'plat_specific'. |
54 | """ | |
55 | if prefix is None: | |
56 | - prefix = plat_specific and EXEC_PREFIX or PREFIX | |
57 | + prefix = plat_specific and SYS_EXEC_PREFIX or SYS_PREFIX | |
58 | ||
59 | if os.name == "posix": | |
60 | if python_build: | |
4d51998b | 61 | @@ -126,7 +128,10 @@ def get_python_lib(plat_specific=0, stan |
0fc165ca JK |
62 | sys.exec_prefix -- i.e., ignore 'plat_specific'. |
63 | """ | |
64 | if prefix is None: | |
65 | - prefix = plat_specific and EXEC_PREFIX or PREFIX | |
66 | + if standard_lib: | |
67 | + prefix = plat_specific and SYS_EXEC_PREFIX or SYS_PREFIX | |
68 | + else: | |
69 | + prefix = plat_specific and EXEC_PREFIX or PREFIX | |
70 | ||
71 | if os.name == "posix": | |
4d51998b JR |
72 | if plat_specific or standard_lib or prefix != "/usr": |
73 | diff -urNp -x '*.orig' Python-2.7.18.org/Lib/site.py Python-2.7.18/Lib/site.py | |
74 | --- Python-2.7.18.org/Lib/site.py 2021-09-26 12:34:36.324550580 +0200 | |
75 | +++ Python-2.7.18/Lib/site.py 2021-09-26 12:34:37.124559456 +0200 | |
76 | @@ -64,7 +64,7 @@ import __builtin__ | |
0fc165ca JK |
77 | import traceback |
78 | ||
79 | # Prefixes for site-packages; add additional prefixes like /usr/local here | |
80 | -PREFIXES = [sys.prefix, sys.exec_prefix] | |
81 | +PREFIXES = ["/usr/local", sys.prefix, sys.exec_prefix] | |
82 | # Enable per user site-packages directory | |
83 | # set it to False to disable the feature or True to force the feature | |
84 | ENABLE_USER_SITE = None |