1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

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
This commit is contained in:
Andrew Tridgell 2011-06-01 11:43:52 +10:00
parent 5a8218b147
commit f725e2b64e

View File

@ -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: