crosvm.updateScript: check for . in buildspec name

Otherwise, we might only match a prefix of the version.  (Although
it's not likely to be a problem in practice — I doubt we'll end up in
a situation where there's a buildspec number 10x the one we're looking
for.)
This commit is contained in:
Alyssa Ross 2022-05-16 11:43:44 +00:00
parent 11ffcf0fdf
commit 931ae3ee7b

View file

@ -48,7 +48,7 @@ chromeos_tip_build = re.match(r'\d+', platform_version)[0]
with urlopen(f'{buildspecs_url}{chrome_major_version}/?format=TEXT') as resp:
listing = base64.decodebytes(resp.read()).decode('utf-8')
buildspecs = [(line.split('\t', 1)[1]) for line in listing.splitlines()]
buildspecs = [s for s in buildspecs if s.startswith(chromeos_tip_build)]
buildspecs = [s for s in buildspecs if s.startswith(f"{chromeos_tip_build}.")]
buildspecs.sort(reverse=True)
buildspec = splitext(buildspecs[0])[0]