[omd-commits] OMD Git: omd: mod_python: patch that fixed share mode (hopefully)

git version control git at mathias-kettner.de
Fri Jun 24 11:03:52 CEST 2011


Module:   omd
Branch:   master
Commit:   54fcedefc8cfcd0418c227ee5f6d998f769537aa
URL:      http://omdistro.org/projects/omd/repository/revisions/54fcedefc8cfcd0418c227ee5f6d998f769537aa

Author:   Mathias Kettner <mk at mathias-kettner.de>
Date:     Fri Jun 24 11:03:43 2011 +0200
Commiter: Mathias Kettner <mk at mathias-kettner.de>
Date:     Fri Jun 24 11:03:43 2011 +0200

mod_python: patch that fixed share mode (hopefully)

---

 packages/mod_python/Makefile                       |    1 +
 .../patches/0004-omd-add-python-path.dif           |   22 ++++++++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/packages/mod_python/Makefile b/packages/mod_python/Makefile
index c2c36db..e69be87 100644
--- a/packages/mod_python/Makefile
+++ b/packages/mod_python/Makefile
@@ -14,6 +14,7 @@ build:
 	    ( cd $(DIR) ; patch -p1 -b ) < $$p ; \
 	done
 	cd $(DIR) ; ./configure $(CONFIGUREOPTS) 
+	echo '#define OMD_VERSION "$(OMD_VERSION)"' > $(DIR)/src/omd_version.h
 	$(MAKE) -C $(DIR) all
 
 install:
diff --git a/packages/mod_python/patches/0004-omd-add-python-path.dif b/packages/mod_python/patches/0004-omd-add-python-path.dif
new file mode 100644
index 0000000..78d35aa
--- /dev/null
+++ b/packages/mod_python/patches/0004-omd-add-python-path.dif
@@ -0,0 +1,22 @@
+--- mod_python-3.3.1/src/mod_python.c.orig	2006-11-09 07:21:23.000000000 +0100
++++ mod_python-3.3.1/src/mod_python.c	2011-06-24 11:02:00.539831985 +0200
+@@ -26,6 +26,7 @@
+  */
+ 
+ #include "mod_python.h"
++#include "omd_version.h"
+ 
+ /* Server object for main server as supplied to python_init(). */
+ static server_rec *main_server = NULL;
+@@ -103,6 +104,11 @@
+      * >>> <initstring>
+      * in the __main__ module to start up Python.
+      */
++    char *old_path = Py_GetPath();
++    char *our_path = "/omd/versions/" OMD_VERSION "/lib/python";
++    char new_path[4096];
++    snprintf(new_path, sizeof(new_path), "%s:%s", our_path, old_path);
++    PySys_SetPath(new_path);
+ 
+     if (! ((m = PyImport_ImportModule(MODULENAME)))) {
+         PyObject *path;



More information about the omd-commits mailing list