Add a -x option that just passes -x to the subshell.
This is often more useful than -v, since it prints the actual commands being executed, not just the lines being input from the script.
This commit is contained in:
parent
03a054ca79
commit
6b0da1fda0
3 changed files with 9 additions and 2 deletions
|
|
@ -73,6 +73,9 @@ def _build(t):
|
||||||
]
|
]
|
||||||
if vars.VERBOSE:
|
if vars.VERBOSE:
|
||||||
argv[1] += 'v'
|
argv[1] += 'v'
|
||||||
|
if vars.XTRACE:
|
||||||
|
argv[1] += 'x'
|
||||||
|
if vars.VERBOSE or vars.XTRACE:
|
||||||
log_('\n')
|
log_('\n')
|
||||||
log('%s\n' % _nice(t))
|
log('%s\n' % _nice(t))
|
||||||
rv = subprocess.call(argv, preexec_fn=lambda: _preexec(t),
|
rv = subprocess.call(argv, preexec_fn=lambda: _preexec(t),
|
||||||
|
|
@ -92,7 +95,7 @@ def _build(t):
|
||||||
f.close()
|
f.close()
|
||||||
if rv != 0:
|
if rv != 0:
|
||||||
raise BuildError('%s: exit code %d' % (t,rv))
|
raise BuildError('%s: exit code %d' % (t,rv))
|
||||||
if vars.VERBOSE:
|
if vars.VERBOSE or vars.XTRACE:
|
||||||
log('%s (done)\n\n' % _nice(t))
|
log('%s (done)\n\n' % _nice(t))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
5
redo.py
5
redo.py
|
|
@ -7,7 +7,8 @@ redo [targets...]
|
||||||
--
|
--
|
||||||
j,jobs= maximum number of jobs to build at once
|
j,jobs= maximum number of jobs to build at once
|
||||||
d,debug print dependency checks as they happen
|
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
|
shuffle randomize the build order to find dependency bugs
|
||||||
debug-locks print messages about file locking (useful for debugging)
|
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)
|
os.environ['REDO_DEBUG'] = str(opt.debug or 0)
|
||||||
if opt.verbose:
|
if opt.verbose:
|
||||||
os.environ['REDO_VERBOSE'] = '1'
|
os.environ['REDO_VERBOSE'] = '1'
|
||||||
|
if opt.xtrace:
|
||||||
|
os.environ['REDO_XTRACE'] = '1'
|
||||||
if opt.shuffle:
|
if opt.shuffle:
|
||||||
os.environ['REDO_SHUFFLE'] = '1'
|
os.environ['REDO_SHUFFLE'] = '1'
|
||||||
if opt.debug_locks:
|
if opt.debug_locks:
|
||||||
|
|
|
||||||
1
vars.py
1
vars.py
|
|
@ -7,6 +7,7 @@ DEPTH = os.environ.get('REDO_DEPTH', '')
|
||||||
DEBUG = atoi.atoi(os.environ.get('REDO_DEBUG', ''))
|
DEBUG = atoi.atoi(os.environ.get('REDO_DEBUG', ''))
|
||||||
DEBUG_LOCKS = os.environ.get('REDO_DEBUG_LOCKS', '') and 1 or 0
|
DEBUG_LOCKS = os.environ.get('REDO_DEBUG_LOCKS', '') and 1 or 0
|
||||||
VERBOSE = os.environ.get('REDO_VERBOSE', '') 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
|
SHUFFLE = os.environ.get('REDO_SHUFFLE', '') and 1 or 0
|
||||||
STARTDIR = os.environ['REDO_STARTDIR']
|
STARTDIR = os.environ['REDO_STARTDIR']
|
||||||
BASE = os.environ['REDO_BASE']
|
BASE = os.environ['REDO_BASE']
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue