dev-lang/python: Update Python 2.7 distutils to not libdir on user
We set libdirname for cross-compilation. The code currently only adds
this variable to the class attributes when not self.user and self.home
is not None, yet we reference this attribute later without testing for
the same conditionals. This adds these conditionals before performing
this look-up.
This fixes `pip install --user` inside the chroot.
BUG=none
TEST=emerge python:2.7; pip install --user setuptools
Change-Id: Ib8397ed397d8c079747556d140bc19d6c91bbde7
Reviewed-on: https://chromium-review.googlesource.com/1339061
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
diff --git a/dev-lang/python/files/python-2.7.10-cross-distutils.patch b/dev-lang/python/files/python-2.7.10-cross-distutils.patch
index 40a4115..9e19d4b 100644
--- a/dev-lang/python/files/python-2.7.10-cross-distutils.patch
+++ b/dev-lang/python/files/python-2.7.10-cross-distutils.patch
@@ -15,11 +15,12 @@
'headers': '$base/include/python$py_version_short/$dist_name',
'scripts': '$base/bin',
'data' : '$base',
-@@ -289,6 +289,7 @@
+@@ -289,6 +289,8 @@
# everything else.
self.config_vars['base'] = self.install_base
self.config_vars['platbase'] = self.install_platbase
-+ self.config_vars['libdirname'] = self.install_libdirname
++ if not self.user and self.home is None:
++ self.config_vars['libdirname'] = self.install_libdirname
if DEBUG:
from pprint import pprint