Set sys.path for running inside source tree.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 11 May 2008 03:45:49 +0000 (05:45 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 11 May 2008 03:45:49 +0000 (05:45 +0200)
(This used to be commit b507109bb676715f7d9616e13b0e19305e9c2559)

source4/scripting/bin/minschema.py
source4/scripting/bin/rpcclient
source4/scripting/bin/samba3dump
source4/scripting/bin/subunitrun
source4/scripting/bin/winreg.py
source4/setup/newuser
source4/setup/provision
source4/setup/upgrade.py

index fb9d7b05aa222687348a8ca8c65055354972445f..6dd5b42affb4d47d211904465f0fe13f10bd2b8f 100755 (executable)
@@ -4,6 +4,10 @@
 #
 
 import optparse
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
 import samba
 from samba import getopt as options
 import sys
index 34efafdf730cdef7106479a2dde0b358e069ceae..aba4f9ddb3e666c647802e15c139317052a88fc0 100755 (executable)
@@ -1,6 +1,10 @@
 #!/usr/bin/python
 
 import sys, os, string
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
 from cmd import Cmd
 from optparse import OptionParser
 from pprint import pprint
index 8f56d423d8cef16ef84a0af2ba75af9b249f638f..d89667233f154635bd9d263c673c5b6e8edccd40 100755 (executable)
@@ -7,7 +7,10 @@
 
 import optparse
 import os, sys
-sys.path.append(os.path.join(os.path.dirname(__file__), "../python"))
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
 import samba
 import samba.samba3
 
index 719a58d9e503ea13b5e689ca5d0e26c0e176210b..de11aba3ccf40e76eefbc9d89f26054304842af6 100755 (executable)
@@ -18,7 +18,9 @@
 #
 
 import sys
-sys.path.append("bin/python")
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
 
 from subunit import SubunitTestRunner
 from unittest import TestProgram
index 1e39ee8f78e41a25f0432e48e304993806d3afea..19d39e56ab3a37b36c6f8aed14c8aff4cf7b5d1b 100755 (executable)
@@ -7,6 +7,10 @@
 #
 
 import sys
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
 import winreg
 import optparse
 import samba.getopt as options
index 04a5440ee1a205650f7cb3d6f1fd0f0391a25c30..26bac76f02f4913ced1e1c5e359da30c6852b9c2 100755 (executable)
@@ -6,10 +6,14 @@
 #      Released under the GNU GPL version 3 or later
 #
 
+import sys
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
 import samba.getopt as options
 import optparse
 import pwd
-import sys
 from getpass import getpass
 from auth import system_session
 from samba.samdb import SamDB
index ad289aaaa31485e20ac83ad968ced120e92a989b..2579bc4f197528225985be30763faa0d46925900 100755 (executable)
@@ -26,7 +26,8 @@ import getopt
 import optparse
 import os, sys
 
-sys.path.append("bin/python")
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
 
 import samba
 import param
index 3bcc57ab64770169ca7d13b7fd2ee5a8259d1cf4..b1d9ffa37cb2c383eebafd246f19b4f50880090e 100755 (executable)
@@ -7,6 +7,10 @@
 import getopt
 import optparse
 import os, sys
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
 import param
 import samba
 import samba.getopt as options