mirror of
https://github.com/servo/servo.git
synced 2025-06-20 07:08:59 +01:00
Auto-update in-tree bindings
This commit is contained in:
parent
fde9ac1768
commit
af487f5730
2 changed files with 22 additions and 7 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue