Slightly clarify the initialization code in redo.py.
This commit is contained in:
parent
12983bd88d
commit
700873a90f
1 changed files with 10 additions and 12 deletions
22
redo.py
22
redo.py
|
|
@ -22,9 +22,16 @@ if opt.verbose:
|
|||
if opt.shuffle:
|
||||
os.environ['REDO_SHUFFLE'] = '1'
|
||||
|
||||
is_root = False
|
||||
if not os.environ.get('REDO_BASE', ''):
|
||||
is_root = True
|
||||
is_root = not os.environ.get('REDO_BASE', '')
|
||||
|
||||
if is_root:
|
||||
# toplevel call to redo
|
||||
exenames = [os.path.abspath(sys.argv[0]), os.path.realpath(sys.argv[0])]
|
||||
if exenames[0] == exenames[1]:
|
||||
exenames = [exenames[0]]
|
||||
dirnames = [os.path.dirname(p) for p in exenames]
|
||||
os.environ['PATH'] = ':'.join(dirnames) + ':' + os.environ['PATH']
|
||||
|
||||
base = os.path.commonprefix([os.path.abspath(os.path.dirname(t))
|
||||
for t in targets] + [os.getcwd()])
|
||||
bsplit = base.split('/')
|
||||
|
|
@ -45,15 +52,6 @@ from helpers import err
|
|||
if is_root:
|
||||
state.init()
|
||||
|
||||
|
||||
if not vars.DEPTH:
|
||||
# toplevel call to redo
|
||||
exenames = [os.path.abspath(sys.argv[0]), os.path.realpath(sys.argv[0])]
|
||||
if exenames[0] == exenames[1]:
|
||||
exenames = [exenames[0]]
|
||||
dirnames = [os.path.dirname(p) for p in exenames]
|
||||
os.environ['PATH'] = ':'.join(dirnames) + ':' + os.environ['PATH']
|
||||
|
||||
try:
|
||||
j = atoi.atoi(opt.jobs or 1)
|
||||
if j < 1 or j > 1000:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue