Sort all os.listdir and os.walk to keep things more reproducible

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-03-10 00:00:04 +00:00
parent 2e3f4c1484
commit a9160d2217
6 changed files with 21 additions and 16 deletions

View File

@@ -866,7 +866,10 @@ lunch aosp_{}-eng
List checkpoint directory, oldest first.
'''
prefix_re = re.compile(self.env['gem5_cpt_prefix'])
files = list(filter(lambda x: os.path.isdir(os.path.join(self.env['m5out_dir'], x)) and prefix_re.search(x), os.listdir(self.env['m5out_dir'])))
files = list(filter(
lambda x: os.path.isdir(os.path.join(self.env['m5out_dir'], x))
and prefix_re.search(x), os.listdir(self.env['m5out_dir'])
))
files.sort(key=lambda x: os.path.getmtime(os.path.join(self.env['m5out_dir'], x)))
return files