From bae8316285aa46e3c944b33a11cce1761efa062e Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Thu, 5 Nov 2015 18:57:14 +0100 Subject: [PATCH 1/2] build:wafsamba: Include the print_commands.py tool from upstream The tool 'print_commands' is provided by default in Waf 1.8. Keeping the old code in Samba complicates the Waf upgrade. Signed-off-by: Thomas Nagy --- .../waf/wafadmin/3rdparty/print_commands.py | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 third_party/waf/wafadmin/3rdparty/print_commands.py diff --git a/third_party/waf/wafadmin/3rdparty/print_commands.py b/third_party/waf/wafadmin/3rdparty/print_commands.py new file mode 100644 index 0000000..3b12aa3 --- /dev/null +++ b/third_party/waf/wafadmin/3rdparty/print_commands.py @@ -0,0 +1,25 @@ +#! /usr/bin/env python + +""" +In this case, print the commands being executed as strings +(the commands are usually lists, so this can be misleading) +""" + +import Build, Utils, Logs + +def exec_command(self, cmd, **kw): + txt = cmd + if isinstance(cmd, list): + txt = ' '.join(cmd) + Logs.debug('runner: %s' % txt) + if self.log: + self.log.write('%s\n' % cmd) + kw['log'] = self.log + try: + if not kw.get('cwd', None): + kw['cwd'] = self.cwd + except AttributeError: + self.cwd = kw['cwd'] = self.bldnode.abspath() + return Utils.exec_command(cmd, **kw) +Build.BuildContext.exec_command = exec_command + From 555b056e4342ce21e64dc123d374a3d70e4aabe1 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Thu, 5 Nov 2015 19:00:18 +0100 Subject: [PATCH 2/2] build:wafsamba: Remove the print_commands code from the build scripts Using the print_commands tool makes it easier to upgrade to Waf 1.8. Signed-off-by: Thomas Nagy --- buildtools/wafsamba/samba_utils.py | 21 --------------------- buildtools/wafsamba/wscript | 1 + 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py index 36d3929..6f4c22a 100644 --- a/buildtools/wafsamba/samba_utils.py +++ b/buildtools/wafsamba/samba_utils.py @@ -135,27 +135,6 @@ def dict_concat(d1, d2): if t not in d1: d1[t] = d2[t] - -def exec_command(self, cmd, **kw): - '''this overrides the 'waf -v' debug output to be in a nice - unix like format instead of a python list. - Thanks to ita on #waf for this''' - _cmd = cmd - if isinstance(cmd, list): - _cmd = ' '.join(cmd) - debug('runner: %s' % _cmd) - if self.log: - self.log.write('%s\n' % cmd) - kw['log'] = self.log - try: - if not kw.get('cwd', None): - kw['cwd'] = self.cwd - except AttributeError: - self.cwd = kw['cwd'] = self.bldnode.abspath() - return Utils.exec_command(cmd, **kw) -Build.BuildContext.exec_command = exec_command - - def ADD_COMMAND(opt, name, function): '''add a new top level command to waf''' Utils.g_module.__dict__[name] = function diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index 69c556c..b0a7e02 100755 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -216,6 +216,7 @@ def configure(conf): # load our local waf extensions conf.check_tool('gnu_dirs') conf.check_tool('wafsamba') + conf.check_tool('print_commands') conf.CHECK_CC_ENV()