summaryrefslogtreecommitdiff
path: root/meta/recipes-devtools/python/python3
diff options
context:
space:
mode:
authorAlejandro Hernandez <alejandro.hernandez@linux.intel.com>2015-04-16 09:45:29 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-05 22:14:20 +0100
commitc27a5a9ba649e7fcf681f6ac4575442e252fd29b (patch)
treeff02af7cbdaad8016e578db279c3f6c074ec2cd1 /meta/recipes-devtools/python/python3
parent59bad496fb57fdc5356ddc343f58eb69ff207863 (diff)
downloadopenembedded-core-c27a5a9ba649e7fcf681f6ac4575442e252fd29b.tar.gz
openembedded-core-c27a5a9ba649e7fcf681f6ac4575442e252fd29b.tar.bz2
openembedded-core-c27a5a9ba649e7fcf681f6ac4575442e252fd29b.zip
python3-native: Fix pip install issue due to unclean build directory
When installing python3-native sometimes pips default build directory (which is on the host and is user dependant) is left unclean, due to this, when python3-core is being installed it tries to use the same directory producing an error, this explicitly removes what the previous installation might have left behind, fixing the issue. Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python3')
-rw-r--r--meta/recipes-devtools/python/python3/pip_build_directory_unclean.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/pip_build_directory_unclean.patch b/meta/recipes-devtools/python/python3/pip_build_directory_unclean.patch
new file mode 100644
index 0000000000..c0c4617d59
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/pip_build_directory_unclean.patch
@@ -0,0 +1,28 @@
+Index: Python-3.4.2/Lib/ensurepip/__init__.py
+===================================================================
+--- Python-3.4.2.orig/Lib/ensurepip/__init__.py
++++ Python-3.4.2/Lib/ensurepip/__init__.py
+@@ -3,6 +3,7 @@ import os.path
+ import pkgutil
+ import sys
+ import tempfile
++import pwd
+
+
+ __all__ = ["version", "bootstrap"]
+@@ -36,6 +37,15 @@ def _run_pip(args, additional_paths=None
+ if additional_paths is not None:
+ sys.path = additional_paths + sys.path
+
++ # Explicitly make sure pip build directory was left clean
++ user = pwd.getpwuid(os.getuid())[0]
++ if os.path.exists("/tmp/pip_build_" + user + "/pip-delete-this-directory.txt"):
++ os.remove("/tmp/pip_build_" + user + "/pip-delete-this-directory.txt")
++ try:
++ os.rmdir("/tmp/pip_build_" + user + "/")
++ except OSError:
++ print("Error: Pip build directory (%s) was left unclean, make sure it is clean before continuing\n" % ("/tmp/pip_build_" + user + "/"))
++
+ # Install the bundled software
+ import pip
+ pip.main(args)