summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-09-08 22:45:12 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-09-08 22:52:43 +0200
commit8140182f3d53019702f49330a40ffa9d47d8d3df (patch)
tree4130923329e239ff5262a6174b53f8908c66e3a8
parentb4b453a287781eba7adaa3c38bd174642a5cb651 (diff)
downloadsamba-8140182f3d53019702f49330a40ffa9d47d8d3df.tar.gz
samba-8140182f3d53019702f49330a40ffa9d47d8d3df.tar.bz2
samba-8140182f3d53019702f49330a40ffa9d47d8d3df.zip
wafsamba: Eliminate sys.path updating if installing to a standard python
path.
-rw-r--r--buildtools/wafsamba/wafsamba.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 50d0df24a0..11de9d5dcc 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -594,8 +594,14 @@ def install_file(bld, destdir, file, chmod=0644, flat=False,
if python_fixup:
# fixup the python path it will use to find Samba modules
inst_file = file + '.inst'
+ if bld.env["PYTHONDIR"] not in sys.path:
+ regex = "s|\(sys.path.insert.*\)bin/python\(.*\)$|\\1${PYTHONDIR}\\2|g"
+ else:
+ # Eliminate updating sys.path if the target python dir is already
+ # in python path.
+ regex = "s|sys.path.insert.*bin/python.*$||g"
bld.SAMBA_GENERATOR('python_%s' % destname,
- rule="sed 's|\(sys.path.insert.*\)bin/python\(.*\)$|\\1${PYTHONDIR}\\2|g' < ${SRC} > ${TGT}",
+ rule="sed '%s' < ${SRC} > ${TGT}" % regex,
source=file,
target=inst_file)
file = inst_file