provision: Look for Samba prefix a bit harder.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 20 Jun 2010 15:46:39 +0000 (17:46 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 20 Jun 2010 15:46:39 +0000 (17:46 +0200)
source4/scripting/python/samba/provision.py

index 804bbe78ea8cb6a1a192dec38f496e48ec03f96f..cfba780baf137371e39e35a4c570cc6d2e83d28e 100644 (file)
@@ -66,10 +66,12 @@ __docformat__ = "restructuredText"
 def find_setup_dir():
     """Find the setup directory used by provision."""
     import sys
-    for suffix in ["share/setup", "share/samba/setup", "setup"]:
-        ret = os.path.join(sys.prefix, suffix)
-        if os.path.isdir(ret):
-            return ret
+    for prefix in [sys.prefix,
+            os.path.join(os.path.dirname(__file__), "../../../..")]:
+        for suffix in ["share/setup", "share/samba/setup", "setup"]:
+            ret = os.path.join(prefix, suffix)
+            if os.path.isdir(ret):
+                return ret
     # In source tree
     dirname = os.path.dirname(__file__)
     ret = os.path.join(dirname, "../../../setup")