s4-python: get ordering right on python paths
authorAndrew Tridgell <tridge@samba.org>
Sun, 6 Feb 2011 22:45:26 +0000 (09:45 +1100)
committerAndrew Tridgell <tridge@samba.org>
Mon, 7 Feb 2011 02:22:02 +0000 (13:22 +1100)
we need to have PYTHONARCHDIR first, as that is where we currently
install. That will minimise problems with upgrades from old installs.

We also don't need to add the path twice if PYTHONDIR is the same as
PYTHONARCHDIR (as happens on debian based systems)

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/scripting/python/modules.c

index f2a45a98932271fce1f7b88946c3bc433e2e6153..9c6a0085589b7414d44226b49796f5e849335e91 100644 (file)
@@ -50,12 +50,14 @@ bool py_update_path()
                return false;
        }
 
-       if (!PySys_PathPrepend(py_path, dyn_PYTHONARCHDIR)) {
+       if (!PySys_PathPrepend(py_path, dyn_PYTHONDIR)) {
                return false;
        }
 
-       if (!PySys_PathPrepend(py_path, dyn_PYTHONDIR)) {
-               return false;
+       if (strcmp(dyn_PYTHONARCHDIR, dyn_PYTHONDIR) != 0) {
+               if (!PySys_PathPrepend(py_path, dyn_PYTHONARCHDIR)) {
+                       return false;
+               }
        }
 
        return true;