From 66187e879e2f184a98412a2a92c1afae795fd482 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Sat, 4 Dec 2010 05:41:10 -0800 Subject: [PATCH] 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. --- builder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builder.py b/builder.py index 54a3057..1edd35d 100644 --- a/builder.py +++ b/builder.py @@ -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