summaryrefslogtreecommitdiffstats
path: root/package/python/python-2.7-020-gentoo_py_dontcompile.patch
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@anandra.org>2010-12-10 23:05:39 +0100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2011-01-25 08:56:20 +0100
commitd82df10e90ee9457ea0baba2d6a766149d4b7c38 (patch)
treec99a4dab60853a69a86061328c2ad965ef5aa226 /package/python/python-2.7-020-gentoo_py_dontcompile.patch
parentafe54f1008dee29af6338d8766381aad9e2871bd (diff)
downloadbuildroot-novena-d82df10e90ee9457ea0baba2d6a766149d4b7c38.tar.gz
buildroot-novena-d82df10e90ee9457ea0baba2d6a766149d4b7c38.zip
python: Port the python2.4 patches to 2.7
Signed-off-by: Maxime Ripard <ripard@archos.com>
Diffstat (limited to 'package/python/python-2.7-020-gentoo_py_dontcompile.patch')
-rw-r--r--package/python/python-2.7-020-gentoo_py_dontcompile.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/package/python/python-2.7-020-gentoo_py_dontcompile.patch b/package/python/python-2.7-020-gentoo_py_dontcompile.patch
new file mode 100644
index 000000000..276f0e6f4
--- /dev/null
+++ b/package/python/python-2.7-020-gentoo_py_dontcompile.patch
@@ -0,0 +1,27 @@
+This patch purpose is to allow not to save the generated python bytecode in
+a file for later use through the PYTHON_DONTCOMPILE environment variable.
+
+I do not see the use of it, because you can choose if you want but it seems
+somewhat related to gentoo.
+
+Maybe useful when the generated rootfs is mounted on read-only on the target.
+
+Patch ported to python2.7 by Maxime Ripard <ripard@archos.com>
+
+diff -rduNp Python-2.7.orig/Python/import.c Python-2.7/Python/import.c
+--- Python-2.7.orig/Python/import.c 2010-09-30 12:05:53.000000000 +0200
++++ Python-2.7/Python/import.c 2010-09-30 12:20:38.000000000 +0200
+@@ -886,7 +886,12 @@ write_compiled_module(PyCodeObject *co,
+ mode_t mode = srcstat->st_mode & ~S_IXUSR & ~S_IXGRP & ~S_IXOTH;
+ #endif
+
+- fp = open_exclusive(cpathname, mode);
++ char *py_dontcompile = getenv("PYTHON_DONTCOMPILE");
++
++ if (!py_dontcompile)
++ fp = open_exclusive(cpathname, mode);
++ else
++ fp = NULL;
+ if (fp == NULL) {
+ if (Py_VerboseFlag)
+ PySys_WriteStderr(