builder.py: detect overrides by only ctime, not all of struct stat.

We were accidentally including things like the atime in the comparison,
which is obviously silly; someone reading the file shouldn't mark it as a
manual override.
This commit is contained in:
Avery Pennarun 2011-03-10 14:17:35 -08:00
commit 4bf569c2a4

View file

@ -221,7 +221,8 @@ class BuildJob:
after_t = _try_stat(t) after_t = _try_stat(t)
st1 = os.fstat(f.fileno()) st1 = os.fstat(f.fileno())
st2 = _try_stat(self.tmpname2) st2 = _try_stat(self.tmpname2)
if (after_t and after_t != before_t and if (after_t and
(not before_t or before_t.st_ctime != after_t.st_ctime) and
not stat.S_ISDIR(after_t.st_mode)): not stat.S_ISDIR(after_t.st_mode)):
err('%s modified %s directly!\n' % (self.argv[2], t)) err('%s modified %s directly!\n' % (self.argv[2], t))
err('...you should update $3 (a temp file) or stdout, not $1.\n') err('...you should update $3 (a temp file) or stdout, not $1.\n')