blob: 8785a6ee7b6f21f442eb02f91d607271d5533799 [file] [log] [blame] [edit]
diff -Naur Python-3.8.0-orig/Lib/distutils/command/install.py Python-3.8.0/Lib/distutils/command/install.py
--- Python-3.8.0-orig/Lib/distutils/command/install.py 2019-10-14 16:34:47.000000000 +0300
+++ Python-3.8.0/Lib/distutils/command/install.py 2019-10-22 10:03:18.045384600 +0300
@@ -341,7 +341,8 @@
# Convert directories from Unix /-separated syntax to the local
# convention.
- self.convert_paths('lib', 'purelib', 'platlib',
+ self.convert_paths('base', 'platbase',
+ 'lib', 'purelib', 'platlib',
'scripts', 'data', 'headers',
'userbase', 'usersite')
diff -Naur Python-3.8.0-orig/Lib/distutils/util.py Python-3.8.0/Lib/distutils/util.py
--- Python-3.8.0-orig/Lib/distutils/util.py 2019-10-22 10:01:56.753641800 +0300
+++ Python-3.8.0/Lib/distutils/util.py 2019-10-22 10:03:18.450985300 +0300
@@ -130,6 +130,13 @@
paths.remove('.')
if not paths:
return os.curdir
+ # On Windows, if paths is ['C:','folder','subfolder'] then
+ # os.path.join(*paths) will return 'C:folder\subfolder' which
+ # is thus relative to the CWD on that drive. So we work around
+ # this by adding a \ to path[0]
+ if (len(paths) > 0 and paths[0].endswith(':') and
+ sys.platform == "win32" and sys.version.find("GCC") >= 0):
+ paths[0] += '\\'
return os.path.join(*paths)
# convert_path ()
@@ -140,6 +147,10 @@
relative, this is equivalent to "os.path.join(new_root,pathname)".
Otherwise, it requires making 'pathname' relative and then joining the
two, which is tricky on DOS/Windows and Mac OS.
+
+ If on Windows or OS/2 and both new_root and pathname are on different
+ drives, raises DistutilsChangeRootError as this is nonsensical,
+ otherwise use drive which can be in either of new_root or pathname.
"""
if os.name == 'posix':
if not os.path.isabs(pathname):
@@ -149,9 +160,20 @@
elif os.name == 'nt':
(drive, path) = os.path.splitdrive(pathname)
- if path[0] == '\\':
+ if path[0] == os.sep:
path = path[1:]
- return os.path.join(new_root, path)
+ (drive_r, path_r) = os.path.splitdrive(new_root)
+ if path_r and path_r[0] == os.sep:
+ path_r = path_r[1:]
+ drive_used = ''
+ if len(drive) == 2 and len(drive_r) == 2 and drive != drive_r:
+ raise DistutilsChangeRootError("root and pathname not on same drive (%s, %s)"
+ % (drive_r,drive))
+ elif len(drive_r) == 2:
+ drive_used = drive_r+os.sep
+ elif len(drive) == 2:
+ drive_used = drive+os.sep
+ return os.path.join(drive_used+path_r, path)
else:
raise DistutilsPlatformError("nothing known about platform '%s'" % os.name)
diff -Naur Python-3.8.0-orig/Makefile.pre.in Python-3.8.0/Makefile.pre.in
--- Python-3.8.0-orig/Makefile.pre.in 2019-10-22 10:02:59.949352800 +0300
+++ Python-3.8.0/Makefile.pre.in 2019-10-22 10:03:18.840986000 +0300
@@ -1612,6 +1612,12 @@
else true; \
fi
+ifeq ($(shell uname -o),Msys)
+DESTDIRFINAL=$(DESTDIR)
+else
+DESTDIRFINAL=$(DESTDIR)/
+endif
+
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
sharedinstall: sharedmods
@@ -1619,9 +1625,9 @@
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
- --root=$(DESTDIR)/
- -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py
- -rm -r $(DESTDIR)$(DESTSHARED)/__pycache__
+ --root=$(DESTDIRFINAL)
+ -rm $(DESTDIRFINAL)$(DESTSHARED)/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py
+ -rm -r $(DESTDIRFINAL)$(DESTSHARED)/__pycache__
# Here are a couple of targets for MacOSX again, to install a full
# framework-based Python. frameworkinstall installs everything, the