redo.py: report when you're trying to rebuild a static file.
In redo-ifchange, this might be a good idea, since you might just want to set a dependency on it, so we won't say anything from inside builder.py. But if you're calling redo.py, that means you expect it to be rebuilt, since there's no other reason to try. So print a warning. (This is what make does, more or less.)
This commit is contained in:
parent
49f0a041b2
commit
1cb000ece1
3 changed files with 13 additions and 5 deletions
|
|
@ -10,14 +10,11 @@ import vars, state, builder, jwack
|
||||||
from helpers import unlink
|
from helpers import unlink
|
||||||
from log import debug, debug2, err
|
from log import debug, debug2, err
|
||||||
|
|
||||||
def _nice(t):
|
|
||||||
return state.relpath(os.path.join(vars.BASE, t), vars.STARTDIR)
|
|
||||||
|
|
||||||
CLEAN = 0
|
CLEAN = 0
|
||||||
DIRTY = 1
|
DIRTY = 1
|
||||||
def dirty_deps(f, depth, max_changed):
|
def dirty_deps(f, depth, max_changed):
|
||||||
if vars.DEBUG >= 1:
|
if vars.DEBUG >= 1:
|
||||||
debug('%s?%s\n' % (depth, _nice(f.name)))
|
debug('%s?%s\n' % (depth, f.nicename()))
|
||||||
|
|
||||||
if f.failed_runid:
|
if f.failed_runid:
|
||||||
debug('%s-- DIRTY (failed last time)\n' % depth)
|
debug('%s-- DIRTY (failed last time)\n' % depth)
|
||||||
|
|
|
||||||
9
redo.py
9
redo.py
|
|
@ -39,9 +39,16 @@ import vars_init
|
||||||
vars_init.init(targets)
|
vars_init.init(targets)
|
||||||
|
|
||||||
import vars, state, builder, jwack
|
import vars, state, builder, jwack
|
||||||
from log import err
|
from log import warn, err
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
for t in targets:
|
||||||
|
if os.path.exists(t):
|
||||||
|
f = state.File(name=t)
|
||||||
|
if not f.is_generated:
|
||||||
|
warn('%s: exists and not marked as generated; not redoing.\n'
|
||||||
|
% f.nicename())
|
||||||
|
|
||||||
j = atoi(opt.jobs or 1)
|
j = atoi(opt.jobs or 1)
|
||||||
if j < 1 or j > 1000:
|
if j < 1 or j > 1000:
|
||||||
err('invalid --jobs value: %r\n' % opt.jobs)
|
err('invalid --jobs value: %r\n' % opt.jobs)
|
||||||
|
|
|
||||||
4
state.py
4
state.py
|
|
@ -276,6 +276,10 @@ class File(object):
|
||||||
# a "unique identifier" stamp for a regular file
|
# a "unique identifier" stamp for a regular file
|
||||||
return str((st.st_ctime, st.st_mtime, st.st_size, st.st_ino))
|
return str((st.st_ctime, st.st_mtime, st.st_size, st.st_ino))
|
||||||
|
|
||||||
|
def nicename(self):
|
||||||
|
return relpath(os.path.join(vars.BASE, self.name), vars.STARTDIR)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# FIXME: I really want to use fcntl F_SETLK, F_SETLKW, etc here. But python
|
# FIXME: I really want to use fcntl F_SETLK, F_SETLKW, etc here. But python
|
||||||
# doesn't do the lockdata structure in a portable way, so we have to use
|
# doesn't do the lockdata structure in a portable way, so we have to use
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue