add patch

This commit is contained in:
tong_1001 2020-09-01 16:05:25 +08:00
parent a3b2e38a5f
commit 6638403e73
2 changed files with 35 additions and 4 deletions

View File

@ -0,0 +1,27 @@
--- /usr/bin/pip3 2019-11-12 17:37:34.793131862 +0100
+++ pip3 2019-11-12 17:40:42.014107134 +0100
@@ -2,7 +2,23 @@
# -*- coding: utf-8 -*-
import re
import sys
-from pip._internal.cli.main import main
+
+try:
+ from pip._internal.cli.main import main
+except ImportError:
+ try:
+ from pip._internal.main import main
+ except ImportError:
+ try:
+ # If the user has downgraded pip, the above import will fail.
+ # Let's try older methods of invoking it:
+
+ # pip 19 uses this
+ from pip._internal import main
+ except ImportError:
+ # older pip versions use this
+ from pip import main
+
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

View File

@ -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.2.2
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
@ -17,6 +17,7 @@ Patch1: allow-stripping-given-prefix-from-wheel-RECORD-files.patch
Patch2: emit-a-warning-when-running-with-root-privileges.patch
Patch3: remove-existing-dist-only-if-path-conflicts.patch
Patch6000: dummy-certifi.patch
Source10: pip-allow-older-versions.patch
%description %{_description}
@ -86,9 +87,9 @@ popd
%endif
# before we ln -s anything, we apply Source10 patch to all pips:
#for PIP in %{buildroot}%{_bindir}/pip*; do
#% patch -p1 --no-backup-if-mismatch $PIP < %{SOURCE10}
#done
for PIP in %{buildroot}%{_bindir}/pip*; do
patch -p1 --no-backup-if-mismatch $PIP < %{SOURCE10}
done
mkdir -p %{buildroot}%{bashcompdir}
PYTHONPATH=%{buildroot}%{python3_sitelib} \
@ -139,6 +140,9 @@ install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir}
%{python_wheeldir}/%{python_wheelname}
%changelog
* Tue Sep 1 2020 wenzhanli<wenzhanli2@huawei.com> - 20.2.2-2
- add pip-allow-older-versions.patch
* Tue Aug 25 2020 wenzhanli<wenzhanli2@huawei.com> - 20.2.2-1
- update to 20.2.2 and add python2 require