diff --git a/builder.py b/builder.py index 71d539d..15ec1fa 100644 --- a/builder.py +++ b/builder.py @@ -73,6 +73,9 @@ def _build(t): ] if vars.VERBOSE: argv[1] += 'v' + if vars.XTRACE: + argv[1] += 'x' + if vars.VERBOSE or vars.XTRACE: log_('\n') log('%s\n' % _nice(t)) rv = subprocess.call(argv, preexec_fn=lambda: _preexec(t), @@ -92,7 +95,7 @@ def _build(t): f.close() if rv != 0: raise BuildError('%s: exit code %d' % (t,rv)) - if vars.VERBOSE: + if vars.VERBOSE or vars.XTRACE: log('%s (done)\n\n' % _nice(t)) diff --git a/redo.py b/redo.py index 86874af..b13df5a 100755 --- a/redo.py +++ b/redo.py @@ -7,7 +7,8 @@ redo [targets...] -- j,jobs= maximum number of jobs to build at once d,debug print dependency checks as they happen -v,verbose print commands as they are run +v,verbose print commands as they are read from .do files (variables intact) +x,xtrace print commands as they are executed (variables expanded) shuffle randomize the build order to find dependency bugs debug-locks print messages about file locking (useful for debugging) """ @@ -20,6 +21,8 @@ if opt.debug: os.environ['REDO_DEBUG'] = str(opt.debug or 0) if opt.verbose: os.environ['REDO_VERBOSE'] = '1' +if opt.xtrace: + os.environ['REDO_XTRACE'] = '1' if opt.shuffle: os.environ['REDO_SHUFFLE'] = '1' if opt.debug_locks: diff --git a/vars.py b/vars.py index 9c0b888..191a0da 100644 --- a/vars.py +++ b/vars.py @@ -7,6 +7,7 @@ DEPTH = os.environ.get('REDO_DEPTH', '') DEBUG = atoi.atoi(os.environ.get('REDO_DEBUG', '')) DEBUG_LOCKS = os.environ.get('REDO_DEBUG_LOCKS', '') and 1 or 0 VERBOSE = os.environ.get('REDO_VERBOSE', '') and 1 or 0 +XTRACE = os.environ.get('REDO_XTRACE', '') and 1 or 0 SHUFFLE = os.environ.get('REDO_SHUFFLE', '') and 1 or 0 STARTDIR = os.environ['REDO_STARTDIR'] BASE = os.environ['REDO_BASE']