summaryrefslogtreecommitdiff
path: root/third_party
diff options
context:
space:
mode:
authorThomas Nagy <tnagy@waf.io>2015-11-05 18:57:14 +0100
committerAndrew Bartlett <abartlet@samba.org>2015-11-06 10:37:24 +0100
commit7c5a92a1043d5990d415014f081c8cd560fd3caa (patch)
treeb172fdf0a0f96dd258e2e8b1425ce82ca4059f61 /third_party
parent963ccff806cf58898cdc8808138453d95df41b01 (diff)
downloadsamba-7c5a92a1043d5990d415014f081c8cd560fd3caa.tar.gz
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 <tnagy@waf.io> Reviewed-by: Uri Simchoni uri@samba.org Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'third_party')
-rw-r--r--third_party/waf/wafadmin/3rdparty/print_commands.py25
1 files changed, 25 insertions, 0 deletions
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 00000000000..3b12aa31c11
--- /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
+