Slightly improve the "if target already existed" rule to ignore directories.

So if you have a default.do, it might be used to build mydir, even if mydir
already existed when we started.

This might be useful if you have a mydir.setup.do and a mydir.do; mydir.do
depends on mydir.setup.do, but mydir.setup.do creates mydir, it just doesn't
*finish* with mydir.  Still, my the time mydir.do runs, mydir already
exists, and redo would get confused.

I think directories are fundamentally special in this way, because it makes
sense to "create" a directory even if that directory isn't "done" at this
phase.
This commit is contained in:
Avery Pennarun 2010-12-04 05:41:10 -08:00
commit 66187e879e

View file

@ -57,7 +57,8 @@ class BuildJob:
if not self.shouldbuildfunc(t):
# target doesn't need to be built; skip the whole task
return self._after2(0)
if (os.path.exists(t) and not state.is_generated(t)
if (os.path.exists(t) and not os.path.exists(t + '/.')
and not state.is_generated(t)
and not os.path.exists('%s.do' % t)):
# an existing source file that is not marked as a generated file.
# This step is mentioned by djb in his notes. It turns out to be