From 4bf569c2a4acbe6e8afe0f907d478eddacdf393a Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Thu, 10 Mar 2011 14:17:35 -0800 Subject: [PATCH] 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. --- builder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builder.py b/builder.py index 63a6caa..a9a00be 100644 --- a/builder.py +++ b/builder.py @@ -221,7 +221,8 @@ class BuildJob: after_t = _try_stat(t) st1 = os.fstat(f.fileno()) 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)): err('%s modified %s directly!\n' % (self.argv[2], t)) err('...you should update $3 (a temp file) or stdout, not $1.\n')