diff options
Diffstat (limited to 'python/servo/command_base.py')
-rw-r--r-- | python/servo/command_base.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py index b337ca5e9ed..0facab6061e 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -50,12 +50,17 @@ def setlocale(name): def find_dep_path_newest(package, bin_path): deps_path = path.join(path.split(bin_path)[0], "build") + candidates = [] with cd(deps_path): - candidates = glob(package + '-*') - candidates = (path.join(deps_path, c) for c in candidates) - candidate_times = sorted(((path.getmtime(c), c) for c in candidates), reverse=True) - if len(candidate_times) > 0: - return candidate_times[0][1] + for c in glob(package + '-*'): + candidate_path = path.join(deps_path, c) + candidate_output = path.join(candidate_path, "output") + if path.exists(candidate_output): + candidates.append((path.getmtime(candidate_output), candidate_path)) + candidates.sort(reverse=True) + if candidates: + _, candidate_path = candidates[0] + return candidate_path return None |