From 931ae3ee7b329a70408f65cece61cbfcff1caca2 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 16 May 2022 11:43:44 +0000 Subject: [PATCH] crosvm.updateScript: check for . in buildspec name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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.) --- pkgs/applications/virtualization/crosvm/update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/virtualization/crosvm/update.py b/pkgs/applications/virtualization/crosvm/update.py index dee2ff904731..79feaa6fa43e 100755 --- a/pkgs/applications/virtualization/crosvm/update.py +++ b/pkgs/applications/virtualization/crosvm/update.py @@ -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]