Only mkdirp() the .redo directory in one place right at the beginning.
This doesn't really seem to change anything, but it's more correct and should reveal weirdness (especially an incorrect .redo directory in a sub-redo) sooner.
This commit is contained in:
parent
dc3efb69cc
commit
132ff02840
3 changed files with 9 additions and 7 deletions
|
|
@ -46,7 +46,6 @@ if not vars.TARGET:
|
|||
try:
|
||||
want_build = []
|
||||
for t in sys.argv[1:]:
|
||||
mkdirp('%s/.redo' % vars.BASE)
|
||||
state.add_dep(vars.TARGET, 'm', t)
|
||||
if dirty_deps(t, depth = ''):
|
||||
want_build.append(t)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ if not vars.TARGET:
|
|||
|
||||
try:
|
||||
for t in sys.argv[1:]:
|
||||
mkdirp('%s/.redo' % vars.BASE)
|
||||
if os.path.exists(t):
|
||||
err('redo-ifcreate: error: %r already exists\n' % t)
|
||||
sys.exit(1)
|
||||
|
|
|
|||
14
redo.py
14
redo.py
|
|
@ -22,7 +22,9 @@ if opt.verbose:
|
|||
if opt.shuffle:
|
||||
os.environ['REDO_SHUFFLE'] = '1'
|
||||
|
||||
is_root = False
|
||||
if not os.environ.get('REDO_BASE', ''):
|
||||
is_root = True
|
||||
base = os.path.commonprefix([os.path.abspath(os.path.dirname(t))
|
||||
for t in targets] + [os.getcwd()])
|
||||
bsplit = base.split('/')
|
||||
|
|
@ -35,18 +37,21 @@ if not os.environ.get('REDO_BASE', ''):
|
|||
os.environ['REDO_STARTDIR'] = os.getcwd()
|
||||
os.environ['REDO'] = os.path.abspath(sys.argv[0])
|
||||
|
||||
|
||||
import vars, state
|
||||
from helpers import *
|
||||
|
||||
|
||||
if is_root:
|
||||
# FIXME: just wiping out all the locks is kind of cheating. But we
|
||||
# only do this from the toplevel redo process, so unless the user
|
||||
# deliberately starts more than one redo on the same repository, it's
|
||||
# sort of ok.
|
||||
mkdirp('%s/.redo' % base)
|
||||
for f in glob.glob('%s/.redo/lock^*' % base):
|
||||
os.unlink(f)
|
||||
|
||||
|
||||
import vars, state
|
||||
from helpers import *
|
||||
|
||||
|
||||
class BuildError(Exception):
|
||||
pass
|
||||
class BuildLocked(Exception):
|
||||
|
|
@ -139,7 +144,6 @@ def _build(t):
|
|||
|
||||
|
||||
def build(t):
|
||||
mkdirp('%s/.redo' % vars.BASE)
|
||||
lock = state.Lock(t)
|
||||
lock.lock()
|
||||
if not lock.owned:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue