diff options
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/python/python3-native_3.4.2.bb | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python3/pip_build_directory_unclean.patch | 28 |
2 files changed, 29 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-native_3.4.2.bb b/meta/recipes-devtools/python/python3-native_3.4.2.bb index d98a278867..37399be69c 100644 --- a/meta/recipes-devtools/python/python3-native_3.4.2.bb +++ b/meta/recipes-devtools/python/python3-native_3.4.2.bb | |||
@@ -26,6 +26,7 @@ file://makerace.patch \ | |||
26 | ${DISTRO_SRC_URI} \ | 26 | ${DISTRO_SRC_URI} \ |
27 | file://sysconfig.py-add-_PYTHON_PROJECT_SRC.patch \ | 27 | file://sysconfig.py-add-_PYTHON_PROJECT_SRC.patch \ |
28 | file://setup.py-check-cross_compiling-when-get-FLAGS.patch \ | 28 | file://setup.py-check-cross_compiling-when-get-FLAGS.patch \ |
29 | file://pip_build_directory_unclean.patch \ | ||
29 | " | 30 | " |
30 | SRC_URI[md5sum] = "36fc7327c02c6f12fa24fc9ba78039e3" | 31 | SRC_URI[md5sum] = "36fc7327c02c6f12fa24fc9ba78039e3" |
31 | SRC_URI[sha256sum] = "1c6d9682d145c056537e477bbfa060ce727f9edd38df1827e0f970dcf04b2def" | 32 | SRC_URI[sha256sum] = "1c6d9682d145c056537e477bbfa060ce727f9edd38df1827e0f970dcf04b2def" |
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 @@ | |||
1 | Index: Python-3.4.2/Lib/ensurepip/__init__.py | ||
2 | =================================================================== | ||
3 | --- Python-3.4.2.orig/Lib/ensurepip/__init__.py | ||
4 | +++ Python-3.4.2/Lib/ensurepip/__init__.py | ||
5 | @@ -3,6 +3,7 @@ import os.path | ||
6 | import pkgutil | ||
7 | import sys | ||
8 | import tempfile | ||
9 | +import pwd | ||
10 | |||
11 | |||
12 | __all__ = ["version", "bootstrap"] | ||
13 | @@ -36,6 +37,15 @@ def _run_pip(args, additional_paths=None | ||
14 | if additional_paths is not None: | ||
15 | sys.path = additional_paths + sys.path | ||
16 | |||
17 | + # Explicitly make sure pip build directory was left clean | ||
18 | + user = pwd.getpwuid(os.getuid())[0] | ||
19 | + if os.path.exists("/tmp/pip_build_" + user + "/pip-delete-this-directory.txt"): | ||
20 | + os.remove("/tmp/pip_build_" + user + "/pip-delete-this-directory.txt") | ||
21 | + try: | ||
22 | + os.rmdir("/tmp/pip_build_" + user + "/") | ||
23 | + except OSError: | ||
24 | + print("Error: Pip build directory (%s) was left unclean, make sure it is clean before continuing\n" % ("/tmp/pip_build_" + user + "/")) | ||
25 | + | ||
26 | # Install the bundled software | ||
27 | import pip | ||
28 | pip.main(args) | ||