Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:Update
python-base
adapted-from-F00251-change-user-install-locatio...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File adapted-from-F00251-change-user-install-location.patch of Package python-base
Index: Python-2.7.17/Lib/distutils/command/install.py =================================================================== --- Python-2.7.17.orig/Lib/distutils/command/install.py +++ Python-2.7.17/Lib/distutils/command/install.py @@ -431,8 +431,18 @@ class install (Command): raise DistutilsOptionError, \ "must not supply exec-prefix without prefix" - self.prefix = os.path.normpath(sys.prefix) - self.exec_prefix = os.path.normpath(sys.exec_prefix) + # self.prefix is set to sys.prefix + /local/ + # if neither RPM build nor virtual environment is + # detected to make pip and distutils install packages + # into the separate location. + if (not hasattr(sys, 'real_prefix') and + 'RPM_BUILD_ROOT' not in os.environ): + addition = "/local" + else: + addition = "" + + self.prefix = os.path.normpath(sys.prefix) + addition + self.exec_prefix = os.path.normpath(sys.exec_prefix) + addition else: if self.exec_prefix is None: Index: Python-2.7.17/Lib/site.py =================================================================== --- Python-2.7.17.orig/Lib/site.py +++ Python-2.7.17/Lib/site.py @@ -291,6 +291,10 @@ def getsitepackages(): sitepackages = [] seen = set() + # '/usr/local' is included in PREFIXES if RPM build is not detected + # to make packages installed into this location visible. + if ENABLE_USER_SITE and 'RPM_BUILD_ROOT' not in os.environ: + PREFIXES.insert(0, "/usr/local") for prefix in PREFIXES: if not prefix or prefix in seen: continue
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor