2018-07-23 15:22:50 +00:00
|
|
|
diff -ru pip-18.0/src/pip/_internal/commands/install.py pip-18.0_patched/src/pip/_internal/commands/install.py
|
|
|
|
--- pip-18.0/src/pip/_internal/commands/install.py 2018-07-20 06:10:48.000000000 +0200
|
|
|
|
+++ pip-18.0_patched/src/pip/_internal/commands/install.py 2018-07-23 16:49:39.085357813 +0200
|
|
|
|
@@ -110,6 +110,14 @@
|
|
|
|
default=None,
|
|
|
|
help="Installation prefix where lib, bin and other top-level "
|
|
|
|
"folders are placed")
|
|
|
|
+ cmd_opts.add_option(
|
2014-04-07 10:26:27 +00:00
|
|
|
+ '--strip-file-prefix',
|
|
|
|
+ dest='strip_file_prefix',
|
|
|
|
+ metavar='prefix',
|
|
|
|
+ default=None,
|
|
|
|
+ help="Strip given prefix from script paths in wheel RECORD."
|
|
|
|
+ )
|
|
|
|
+
|
2016-11-18 21:31:08 +00:00
|
|
|
|
2018-07-23 15:22:50 +00:00
|
|
|
cmd_opts.add_option(cmdoptions.build_dir())
|
2014-04-07 10:26:27 +00:00
|
|
|
|
2018-07-23 15:22:50 +00:00
|
|
|
@@ -345,6 +353,7 @@
|
|
|
|
pycompile=options.compile,
|
|
|
|
warn_script_location=warn_script_location,
|
|
|
|
use_user_site=options.use_user_site,
|
|
|
|
+ strip_file_prefix=options.strip_file_prefix,
|
|
|
|
)
|
2014-04-07 10:26:27 +00:00
|
|
|
|
2018-07-23 15:22:50 +00:00
|
|
|
lib_locations = get_lib_location_guesses(
|
|
|
|
diff -ru pip-18.0/src/pip/_internal/req/req_install.py pip-18.0_patched/src/pip/_internal/req/req_install.py
|
|
|
|
--- pip-18.0/src/pip/_internal/req/req_install.py 2018-07-22 07:14:20.000000000 +0200
|
|
|
|
+++ pip-18.0_patched/src/pip/_internal/req/req_install.py 2018-07-23 16:51:51.115943214 +0200
|
|
|
|
@@ -514,7 +514,7 @@
|
2014-04-07 10:26:27 +00:00
|
|
|
|
2018-07-23 15:22:50 +00:00
|
|
|
def move_wheel_files(self, wheeldir, root=None, home=None, prefix=None,
|
|
|
|
warn_script_location=True, use_user_site=False,
|
|
|
|
- pycompile=True):
|
|
|
|
+ pycompile=True, strip_file_prefix=None):
|
2014-04-07 10:26:27 +00:00
|
|
|
move_wheel_files(
|
|
|
|
self.name, self.req, wheeldir,
|
2018-07-23 15:22:50 +00:00
|
|
|
user=use_user_site,
|
|
|
|
@@ -524,6 +524,7 @@
|
|
|
|
pycompile=pycompile,
|
2015-01-15 13:05:55 +00:00
|
|
|
isolated=self.isolated,
|
2018-07-23 15:22:50 +00:00
|
|
|
warn_script_location=warn_script_location,
|
2014-04-07 10:26:27 +00:00
|
|
|
+ strip_file_prefix=strip_file_prefix,
|
|
|
|
)
|
|
|
|
|
2018-07-23 15:22:50 +00:00
|
|
|
# Things valid for sdists
|
|
|
|
@@ -924,7 +925,7 @@
|
2014-04-07 10:26:27 +00:00
|
|
|
|
2018-07-23 15:22:50 +00:00
|
|
|
def install(self, install_options, global_options=None, root=None,
|
|
|
|
home=None, prefix=None, warn_script_location=True,
|
|
|
|
- use_user_site=False, pycompile=True):
|
|
|
|
+ use_user_site=False, pycompile=True, strip_file_prefix=None):
|
|
|
|
global_options = global_options if global_options is not None else []
|
|
|
|
if self.editable:
|
|
|
|
self.install_editable(
|
|
|
|
@@ -939,6 +940,7 @@
|
|
|
|
self.source_dir, root=root, prefix=prefix, home=home,
|
|
|
|
warn_script_location=warn_script_location,
|
|
|
|
use_user_site=use_user_site, pycompile=pycompile,
|
|
|
|
+ strip_file_prefix=strip_file_prefix,
|
|
|
|
)
|
|
|
|
self.install_succeeded = True
|
|
|
|
return
|
|
|
|
diff -ru pip-18.0/src/pip/_internal/wheel.py pip-18.0_patched/src/pip/_internal/wheel.py
|
|
|
|
--- pip-18.0/src/pip/_internal/wheel.py 2018-07-17 10:26:00.000000000 +0200
|
|
|
|
+++ pip-18.0_patched/src/pip/_internal/wheel.py 2018-07-23 16:52:57.749238655 +0200
|
|
|
|
@@ -206,7 +206,7 @@
|
2014-04-07 10:26:27 +00:00
|
|
|
|
|
|
|
def move_wheel_files(name, req, wheeldir, user=False, home=None, root=None,
|
2018-07-23 15:22:50 +00:00
|
|
|
pycompile=True, scheme=None, isolated=False, prefix=None,
|
|
|
|
- warn_script_location=True):
|
|
|
|
+ warn_script_location=True, strip_file_prefix=None):
|
2014-04-07 10:26:27 +00:00
|
|
|
"""Install a wheel"""
|
|
|
|
|
2014-05-25 22:10:27 +00:00
|
|
|
if not scheme:
|
2018-07-23 15:22:50 +00:00
|
|
|
@@ -507,7 +507,12 @@
|
2014-04-07 10:26:27 +00:00
|
|
|
writer.writerow(row)
|
|
|
|
for f in generated:
|
2018-07-23 15:22:50 +00:00
|
|
|
digest, length = rehash(f)
|
|
|
|
- writer.writerow((normpath(f, lib_dir), digest, length))
|
2016-05-17 14:57:08 +00:00
|
|
|
+ final_path = normpath(f, lib_dir)
|
|
|
|
+ if strip_file_prefix and final_path.startswith(strip_file_prefix):
|
|
|
|
+ final_path = os.path.join(os.sep,
|
|
|
|
+ os.path.relpath(final_path, strip_file_prefix))
|
2018-07-23 15:22:50 +00:00
|
|
|
+ writer.writerow((final_path, digest, length))
|
|
|
|
+
|
2014-04-07 10:26:27 +00:00
|
|
|
for f in installed:
|
|
|
|
writer.writerow((installed[f], '', ''))
|
2016-05-17 14:57:08 +00:00
|
|
|
shutil.move(temp_record, record)
|