diff options
author | Andrew Tridgell <tridge@samba.org> | 2011-06-01 11:43:52 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-06-01 06:50:04 +0200 |
commit | f725e2b64eec48c0fe21a125065152c684d361ee (patch) | |
tree | 4f54eb8dbcf4548fb6eeecfeaefa5ed64889820c | |
parent | 5a8218b147ac62c065903591a15360a906da9bec (diff) | |
download | samba-f725e2b64eec48c0fe21a125065152c684d361ee.tar.gz samba-f725e2b64eec48c0fe21a125065152c684d361ee.tar.bz2 samba-f725e2b64eec48c0fe21a125065152c684d361ee.zip |
build: fixed a problem with installing scripts in the build tree
the SAMBA_SCRIPT() function was not always triggering correctly. The
base problem was that we were using a target outside the build
tree. This implements a simpler solution where we just create the
links directly in SAMBA_SCRIPT() rather than creating a waf task
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Jun 1 06:50:04 CEST 2011 on sn-devel-104
-rw-r--r-- | buildtools/wafsamba/wafsamba.py | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index 2a1c82a307..43b7f616dc 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -628,17 +628,6 @@ def ENABLE_TIMESTAMP_DEPENDENCIES(conf): Utils.h_file = h_file - -t = Task.simple_task_type('copy_script', 'rm -f "${LINK_TARGET}" && ln -s "${SRC[0].abspath(env)}" ${LINK_TARGET}', - shell=True, color='PINK', ext_in='.bin') -t.quiet = True - -@feature('copy_script') -@before('apply_link') -def copy_script(self): - tsk = self.create_task('copy_script', self.allnodes[0]) - tsk.env.TARGET = self.target - def SAMBA_SCRIPT(bld, name, pattern, installdir, installname=None): '''used to copy scripts from the source tree into the build directory for use by selftest''' @@ -653,15 +642,17 @@ def SAMBA_SCRIPT(bld, name, pattern, installdir, installname=None): target = os.path.join(installdir, iname) tgtdir = os.path.dirname(os.path.join(bld.srcnode.abspath(bld.env), '..', target)) mkdir_p(tgtdir) - t = bld(features='copy_script', - source = s, - target = target, - always = True, - install_path = None) - t.env.LINK_TARGET = target - + link_src = os.path.normpath(os.path.join(bld.curdir, s)) + link_dst = os.path.join(tgtdir, os.path.basename(iname)) + if os.path.islink(link_dst) and os.readlink(link_dst) == link_src: + continue + if os.path.exists(link_dst): + os.unlink(link_dst) + Logs.info("symlink: %s -> %s/%s" % (s, installdir, iname)) + os.symlink(link_src, link_dst) Build.BuildContext.SAMBA_SCRIPT = SAMBA_SCRIPT + def copy_and_fix_python_path(task): pattern='sys.path.insert(0, "bin/python")' if task.env["PYTHONARCHDIR"] in sys.path and task.env["PYTHONDIR"] in sys.path: |