From 3cff56ef26ec141bb8d6d4e0e3c930f3ecfb59d1 Mon Sep 17 00:00:00 2001 From: zhanliwen Date: Thu, 6 Aug 2020 10:36:55 +0800 Subject: [PATCH] Fix strip prefix error --- ...given-prefix-from-wheel-RECORD-files.patch | 62 +++++++++++++++++++ python-pip.spec | 10 ++- 2 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 allow-stripping-given-prefix-from-wheel-RECORD-files.patch diff --git a/allow-stripping-given-prefix-from-wheel-RECORD-files.patch b/allow-stripping-given-prefix-from-wheel-RECORD-files.patch new file mode 100644 index 0000000..844ca53 --- /dev/null +++ b/allow-stripping-given-prefix-from-wheel-RECORD-files.patch @@ -0,0 +1,62 @@ +From 3083733a88dcef1c8ce4dcdc99cbeac3b4203baf Mon Sep 17 00:00:00 2001 +From: root +Date: Thu, 6 Aug 2020 09:45:02 +0800 +Subject: [PATCH] allow-stripping-given-prefix-from-wheel-RECORD-files + +--- + src/pip/_internal/commands/install.py | 9 +++++++++ + src/pip/_internal/req/req_install.py | 4 +++- + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py +index 6a68100..16a5e50 100644 +--- a/src/pip/_internal/commands/install.py ++++ b/src/pip/_internal/commands/install.py +@@ -139,6 +139,14 @@ class InstallCommand(RequirementCommand): + default=None, + help="Installation prefix where lib, bin and other top-level " + "folders are placed") ++ cmd_opts.add_option( ++ '--strip-file-prefix', ++ dest='strip_file_prefix', ++ metavar='prefix', ++ default=None, ++ help="Strip given prefix from script paths in wheel RECORD." ++ ) ++ + + cmd_opts.add_option(cmdoptions.build_dir()) + +@@ -424,6 +432,7 @@ class InstallCommand(RequirementCommand): + pycompile=options.compile, + warn_script_location=warn_script_location, + use_user_site=options.use_user_site, ++ strip_file_prefix=options.strip_file_prefix, + ) + + lib_locations = get_lib_location_guesses( +diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py +index 6ee4847..dd67ed7 100644 +--- a/src/pip/_internal/req/req_install.py ++++ b/src/pip/_internal/req/req_install.py +@@ -764,7 +764,8 @@ class InstallRequirement(object): + prefix=None, # type: Optional[str] + warn_script_location=True, # type: bool + use_user_site=False, # type: bool +- pycompile=True # type: bool ++ pycompile=True, # type: bool ++ strip_file_prefix=None + ): + # type: (...) -> None + scheme = get_scheme( +@@ -789,6 +790,7 @@ class InstallRequirement(object): + isolated=self.isolated, + build_env=self.build_env, + unpacked_source_directory=self.unpacked_source_directory, ++ strip_file_prefix=strip_file_prefix, + ) + self.install_succeeded = True + return +-- +2.23.0 + diff --git a/python-pip.spec b/python-pip.spec index d187805..69e78d3 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -7,7 +7,7 @@ pip is the package installer for Python. You can use pip to install packages fro %global bashcompdir %(b=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null); echo ${b:-%{_sysconfdir}/bash_completion.d}) Name: python-%{srcname} Version: 20.1.1 -Release: 1 +Release: 2 Summary: A tool for installing and managing Python packages License: MIT and Python and ASL 2.0 and BSD and ISC and LGPLv2 and MPLv2.0 and (ASL 2.0 or BSD) URL: http://www.pip-installer.org @@ -15,8 +15,9 @@ Source0: https://files.pythonhosted.org/packages/source/p/%{srcname}/%{sr BuildArch: noarch Patch1: emit-a-warning-when-running-with-root-privileges.patch Patch2: remove-existing-dist-only-if-path-conflicts.patch -Patch3: dummy-certifi.patch -Source1: pip-allow-different-versions.patch +Patch3: dummy-certifi.patch +Patch4: allow-stripping-given-prefix-from-wheel-RECORD-files.patch +Source1: pip-allow-different-versions.patch %description %{_description} @@ -104,6 +105,9 @@ install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} %{python_wheeldir}/%{python_wheelname} %changelog +* Wed Aug 5 2020 tianwei - 20.1.1-2 +- fix strip prefix error + * Tue Jul 28 2020 jinzhimin - 20.1.1-1 - update to 20.1.1 -- Gitee