From d8f5d43a9c58113f128b7e6adeefbba555b8aedb Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Thu, 19 Jan 2017 05:13:01 -0800 Subject: [PATCH] python build script: when getting modified time for a directory, also check contents' times --- SheepShaver/src/Windows/build_on_msys.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 86610642..48308cbf 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -534,14 +534,20 @@ class BuildDepTracker(object): return rebuild_required - @staticmethod - def get_inputs_modified_time(input_filenames): + @classmethod + def get_inputs_modified_time(cls, input_filenames): input_file_mtimes = [] for input_filename in input_filenames: + if os.path.isdir(input_filename): + subtime = cls.get_inputs_modified_time(os.path.join(input_filename, s) for s in os.listdir(input_filename)) + if subtime is not None: + input_file_mtimes.append(subtime) stat = os.stat(input_filename) if stat is None: assert False, "Missing input file %s" % input_filename input_file_mtimes.append(stat.st_mtime) + if not input_file_mtimes: + return None input_modified_time = max(input_file_mtimes) return input_modified_time