]> code.ossystems Code Review - openembedded-core.git/commitdiff
python-native: disable user site support
authorYasir-Khan <yasir_khan@mentor.com>
Mon, 8 Sep 2014 11:58:41 +0000 (12:58 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 10 Sep 2014 10:29:50 +0000 (11:29 +0100)
The user site-packages gets inserted into sys.path ahead of the
system site directories, so a site package installed there will
be used in preference to what's in our sysroot, causing less
deterministic builds, and potential build breakage, depending
on what the user has installed there. Disable it for our native
python, so they don't affect our builds.

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Yasir-Khan <yasir_khan@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/python/python-native_2.7.3.bb

index 827654dfa20a89cc7d6e41a4f4ef90f48b088247..e55f5feac21e828072730a3306c6d9baefb05391 100644 (file)
@@ -58,4 +58,8 @@ do_install() {
        # (these often end up too long for the #! parser in the kernel as the
        # buffer is 128 bytes long).
        ln -s python-native/python ${D}${bindir}/nativepython
+       
+       # We don't want modules in ~/.local being used in preference to those
+       # installed in the native sysroot, so disable user site support.
+       sed -i -e 's,^\(ENABLE_USER_SITE = \).*,\1False,' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py
 }