From 6846803620a0e67c4236f3f9f6c3191caf8f2205 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 26 2017 09:55:28 +0000 Subject: import python27-python-pip-8.1.2-2.el7 --- diff --git a/.gitignore b/.gitignore index 3aa0d3d..75d904b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/pip-7.1.0.tar.gz +SOURCES/pip-8.1.2.tar.gz diff --git a/.python27-python-pip.metadata b/.python27-python-pip.metadata index 4e08cb8..f0b3d15 100644 --- a/.python27-python-pip.metadata +++ b/.python27-python-pip.metadata @@ -1 +1 @@ -f0254e9b58d29268125fdf08e4cac303592f26d6 SOURCES/pip-7.1.0.tar.gz +1c13c247967ec5bee6de5fd104c5d78ba30951c7 SOURCES/pip-8.1.2.tar.gz diff --git a/SOURCES/Fix-pip-install-in-FIPS-mode.patch b/SOURCES/Fix-pip-install-in-FIPS-mode.patch new file mode 100644 index 0000000..2c29631 --- /dev/null +++ b/SOURCES/Fix-pip-install-in-FIPS-mode.patch @@ -0,0 +1,29 @@ +From 1dc2aa897ddda51503572f3f70a4818cf9a3884d Mon Sep 17 00:00:00 2001 +From: Tomas Orsava +Date: Fri, 17 Mar 2017 13:14:56 +0100 +Subject: [PATCH] Fix `pip install` in FIPS mode + +Resolves: rhbz#1430763 +--- + pip/utils/hashes.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/pip/utils/hashes.py b/pip/utils/hashes.py +index 9602970..c6d7524 100644 +--- a/pip/utils/hashes.py ++++ b/pip/utils/hashes.py +@@ -39,7 +39,10 @@ class Hashes(object): + gots = {} + for hash_name in iterkeys(self._allowed): + try: +- gots[hash_name] = hashlib.new(hash_name) ++ if hash_name == 'md5': ++ gots[hash_name] = hashlib.new(hash_name, usedforsecurity=False) ++ else: ++ gots[hash_name] = hashlib.new(hash_name) + except (ValueError, TypeError): + raise InstallationError('Unknown hash name: %s' % hash_name) + +-- +2.11.0 + diff --git a/SOURCES/allow-stripping-given-prefix-from-wheel-RECORD-files.patch b/SOURCES/allow-stripping-given-prefix-from-wheel-RECORD-files.patch new file mode 100644 index 0000000..d0cead6 --- /dev/null +++ b/SOURCES/allow-stripping-given-prefix-from-wheel-RECORD-files.patch @@ -0,0 +1,117 @@ +From 7b3991c99cd8bb9358e109901d4aa8f51269a87a Mon Sep 17 00:00:00 2001 +From: Tomas Orsava +Date: Tue, 17 May 2016 16:40:37 +0200 +Subject: [PATCH] Allow stripping given prefix from wheel RECORD files + +Update of a previous patch [0] by Slavek Kabrda . +Changes in the pip/wheel.py file in upstream prevented #2 hunk from being +applied cleanly. + +[0] pip-1.5rc1-allow-stripping-prefix-from-wheel-RECORD-files.patch +--- + pip/commands/install.py | 9 +++++++++ + pip/req/req_install.py | 13 +++++++++---- + pip/wheel.py | 8 ++++++-- + 3 files changed, 24 insertions(+), 6 deletions(-) + +diff --git a/pip/commands/install.py b/pip/commands/install.py +index 7ddde93..e31bd3e 100644 +--- a/pip/commands/install.py ++++ b/pip/commands/install.py +@@ -137,6 +137,14 @@ class InstallCommand(RequirementCommand): + "directory.") + + 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( + '--prefix', + dest='prefix_path', + metavar='dir', +@@ -315,6 +323,7 @@ class InstallCommand(RequirementCommand): + global_options, + root=options.root_path, + prefix=options.prefix_path, ++ strip_file_prefix=options.strip_file_prefix, + ) + reqs = sorted( + requirement_set.successfully_installed, +diff --git a/pip/req/req_install.py b/pip/req/req_install.py +index 9e9fbbb..47f263f 100644 +--- a/pip/req/req_install.py ++++ b/pip/req/req_install.py +@@ -818,8 +818,7 @@ class InstallRequirement(object): + else: + return True + +- def install(self, install_options, global_options=[], root=None, +- prefix=None): ++ def install(self, install_options, global_options=[], root=None, prefix=None, strip_file_prefix=None): + if self.editable: + self.install_editable( + install_options, global_options, prefix=prefix) +@@ -828,7 +827,12 @@ class InstallRequirement(object): + version = pip.wheel.wheel_version(self.source_dir) + pip.wheel.check_compatibility(version, self.name) + +- self.move_wheel_files(self.source_dir, root=root, prefix=prefix) ++ self.move_wheel_files( ++ self.source_dir, ++ root=root, ++ prefix=prefix, ++ strip_file_prefix=strip_file_prefix ++ ) + self.install_succeeded = True + return + +@@ -1021,7 +1025,7 @@ class InstallRequirement(object): + def is_wheel(self): + return self.link and self.link.is_wheel + +- def move_wheel_files(self, wheeldir, root=None, prefix=None): ++ def move_wheel_files(self, wheeldir, root=None, prefix=None, strip_file_prefix=None): + move_wheel_files( + self.name, self.req, wheeldir, + user=self.use_user_site, +@@ -1030,6 +1034,7 @@ class InstallRequirement(object): + prefix=prefix, + pycompile=self.pycompile, + isolated=self.isolated, ++ strip_file_prefix=strip_file_prefix, + ) + + def get_dist(self): +diff --git a/pip/wheel.py b/pip/wheel.py +index b257d76..6d78ce6 100644 +--- a/pip/wheel.py ++++ b/pip/wheel.py +@@ -238,7 +238,7 @@ def get_entrypoints(filename): + + + def move_wheel_files(name, req, wheeldir, user=False, home=None, root=None, +- pycompile=True, scheme=None, isolated=False, prefix=None): ++ pycompile=True, scheme=None, isolated=False, prefix=None, strip_file_prefix=None): + """Install a wheel""" + + if not scheme: +@@ -522,7 +522,11 @@ if __name__ == '__main__': + writer.writerow(row) + for f in generated: + h, l = rehash(f) +- writer.writerow((normpath(f, lib_dir), h, l)) ++ 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)) ++ writer.writerow((final_path, h, l)) + for f in installed: + writer.writerow((installed[f], '', '')) + shutil.move(temp_record, record) +-- +2.5.5 + diff --git a/SOURCES/pip-1.5rc1-allow-stripping-prefix-from-wheel-RECORD-files.patch b/SOURCES/pip-1.5rc1-allow-stripping-prefix-from-wheel-RECORD-files.patch deleted file mode 100644 index d581eee..0000000 --- a/SOURCES/pip-1.5rc1-allow-stripping-prefix-from-wheel-RECORD-files.patch +++ /dev/null @@ -1,99 +0,0 @@ -commit aefacbb76661520415a1c35028f2984e70cfe0bf -Author: Slavek Kabrda -Date: Fri Nov 29 13:24:58 2013 +0100 - - Allow stripping given prefix from wheel RECORD files - -diff --git a/pip/commands/install.py b/pip/commands/install.py -index 1693d01..0287c06 100644 ---- a/pip/commands/install.py -+++ b/pip/commands/install.py -@@ -137,6 +137,14 @@ class InstallCommand(Command): - "directory.") - - 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( - "--compile", - action="store_true", - dest="compile", -@@ -345,6 +353,7 @@ class InstallCommand(Command): - install_options, - global_options, - root=options.root_path, -+ strip_file_prefix=options.strip_file_prefix, - ) - reqs = sorted( - requirement_set.successfully_installed, - -diff --git a/pip/req/req_install.py b/pip/req/req_install.py -index 3ae306d..c171130 100644 ---- a/pip/req/req_install.py -+++ b/pip/req/req_install.py -@@ -615,15 +615,19 @@ exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec')) - else: - return True - -- def install(self, install_options, global_options=[], root=None): -+ def install(self, install_options, global_options=[], root=None, strip_file_prefix=None): - if self.editable: - self.install_editable(install_options, global_options) - return - if self.is_wheel: - version = pip.wheel.wheel_version(self.source_dir) - pip.wheel.check_compatibility(version, self.name) - -- self.move_wheel_files(self.source_dir, root=root) -+ self.move_wheel_files( -+ self.source_dir, -+ root=root, -+ strip_file_prefix=strip_file_prefix -+ ) - self.install_succeeded = True - return - -@@ -844,14 +848,15 @@ exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec')) - def is_wheel(self): - return self.link and self.link.is_wheel - -- def move_wheel_files(self, wheeldir, root=None): -+ def move_wheel_files(self, wheeldir, root=None, strip_file_prefix=None): - move_wheel_files( - self.name, self.req, wheeldir, - user=self.use_user_site, - home=self.target_dir, - root=root, - pycompile=self.pycompile, - isolated=self.isolated, -+ strip_file_prefix=strip_file_prefix, - ) - - def get_dist(self): -diff --git a/pip/wheel.py b/pip/wheel.py -index fa3e270..3a366d0 100644 ---- a/pip/wheel.py -+++ b/pip/wheel.py -@@ -136,7 +136,7 @@ def get_entrypoints(filename): - - - def move_wheel_files(name, req, wheeldir, user=False, home=None, root=None, -- pycompile=True, scheme=None, isolated=False): -+ pycompile=True, scheme=None, isolated=False, strip_file_prefix=None): - """Install a wheel""" - - if not scheme: -@@ -357,6 +357,8 @@ if __name__ == '__main__': - writer.writerow(row) - for f in generated: - h, l = rehash(f) -+ if strip_file_prefix and f.startswith(strip_file_prefix): -+ f = os.path.join(os.sep, os.path.relpath(f, strip_file_prefix)) - writer.writerow((f, h, l)) - for f in installed: - writer.writerow((installed[f], '', '')) diff --git a/SPECS/python-pip.spec b/SPECS/python-pip.spec index e8c058f..706c9e7 100644 --- a/SPECS/python-pip.spec +++ b/SPECS/python-pip.spec @@ -17,15 +17,20 @@ %endif Name: %{?scl_prefix}python-%{srcname} -Version: 7.1.0 +Version: 8.1.2 Release: 2%{?dist} Summary: A tool for installing and managing Python packages Group: Development/Libraries License: MIT URL: http://www.pip-installer.org -Source0: http://pypi.python.org/packages/source/p/pip/%{srcname}-%{version}.tar.gz -Patch0: pip-1.5rc1-allow-stripping-prefix-from-wheel-RECORD-files.patch +Source0: https://files.pythonhosted.org/packages/source/p/pip/%{srcname}-%{version}.tar.gz + +Patch0: allow-stripping-given-prefix-from-wheel-RECORD-files.patch + +# Fix `pip install` failure in FIPS mode +# Resolves: rhbz#1430763 +Patch1: Fix-pip-install-in-FIPS-mode.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -51,6 +56,7 @@ easy_installable should be pip-installable as well. %setup -q -n %{srcname}-%{version} %patch0 -p1 +%patch1 -p1 %{__sed} -i '1d' pip/__init__.py %{?scl:EOF} @@ -113,6 +119,16 @@ sed -i -e "s/^\\(complete.*\\) pip\$/\\1 $pips2/" \ %changelog +* Fri Mar 17 2017 Tomas Orsava - 8.1.2-2 +- Added Patch 1: Fix `pip install` failure in FIPS mode +Resolves: rhbz#1430763 + +* Mon Jan 16 2017 Tomas Orsava - 8.1.2-1 +- Rebased to 8.1.2 +- Updated to a new PyPI source URL +- Rebased and renamed prefix-stripping Patch 0 +Resolves: rhbz#1344674 + * Tue May 10 2016 Charalampos Stratakis - 7.1.0-2 - Change license tag to doc tag so directory is owned by the collection - Will revert when ownership of directories is defined in scl-utils-build package