mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-26 16:31:11 +00:00
python build script: when getting modified time for a directory, also check contents' times
This commit is contained in:
parent
21a6d39d4b
commit
d8f5d43a9c
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user