diff options
author | Amitay Isaacs <amitay@gmail.com> | 2014-07-08 12:15:58 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2014-07-08 10:17:54 +0200 |
commit | 34b4857231df9656eee1ad5e6aa639330403d2de (patch) | |
tree | efa9bde0eee06c6e6f5e3f4a04668cf411c78a06 /ctdb | |
parent | dd1f23dc682c2e45950905cc4c13d032aef83698 (diff) | |
download | samba-34b4857231df9656eee1ad5e6aa639330403d2de.tar.gz |
ctdb-build: Replace os.system with samba_utils.RUN_COMMAND
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb')
-rwxr-xr-x | ctdb/wscript | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/ctdb/wscript b/ctdb/wscript index db5e5b6f430..20a33e8abe6 100755 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -552,14 +552,22 @@ def dist(): samba_dist.DIST_FILES('VERSION:VERSION', extend=True) t = 'include/ctdb_version.h' - out = os.system('packaging/mkversion.sh %s %s' % (t, VERSION)) + cmd = 'packaging/mkversion.sh %s %s' % (t, VERSION) + ret = samba_utils.RUN_COMMAND(cmd) + if ret != 0: + print('Command "%s" failed with exit status %d' % (cmd, ret)) + sys.exit(ret) samba_dist.DIST_FILES('ctdb/%s:%s' % (t, t), extend=True) t = 'ctdb.spec' sed_expr1 = 's/@VERSION@/%s/g' % VERSION sed_expr2 = 's/@RELEASE@/%s/g' % '1' - os.system('sed -e "%s" -e "%s" packaging/RPM/ctdb.spec.in > %s' % - (sed_expr1, sed_expr2, t)) + cmd = 'sed -e "%s" -e "%s" packaging/RPM/ctdb.spec.in > %s' % ( + sed_expr1, sed_expr2, t) + ret = samba_utils.RUN_COMMAND(cmd) + if ret != 0: + print('Command "%s" failed with exit status %d' % (cmd, ret)) + sys.exit(ret) samba_dist.DIST_FILES('ctdb/%s:%s' % (t, t), extend=True) manpages = [ @@ -572,7 +580,11 @@ def dist(): 'ltdbtool.1' ] - os.system('make -C doc') + cmd = 'make -C doc' + ret = samba_utils.RUN_COMMAND(cmd) + if ret != 0: + print('Command "%s" failed with exit status %d' % (cmd, ret)) + sys.exit(ret) for t in manpages: samba_dist.DIST_FILES('ctdb/doc/%s:doc/%s' % (t, t), extend=True) samba_dist.DIST_FILES('ctdb/doc/%s.html:doc/%s.html' % (t, t), @@ -598,4 +610,7 @@ def ctags(ctx): source_root = os.path.dirname(Utils.g_module.root_path) cmd = 'ctags $(find %s/.. -name "*.[ch]" | grep -v "*_proto\.h")' % source_root print("Running: %s" % cmd) - os.system(cmd) + ret = samba_utils.RUN_COMMAND(cmd) + if ret != 0: + print('ctags failed with exit status %d' % ret) + sys.exit(ret) |