diff options
author | Alyssa Ross <hi@alyssa.is> | 2022-03-30 13:30:47 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2022-03-31 10:13:20 +0000 |
commit | f2e61678de300336b3666afd19af7565efb0c4cf (patch) | |
tree | 49f6906c9d557f7fdd58257ff85ec17fc4495f31 /nixpkgs/pkgs/applications/virtualization/crosvm/update.py | |
parent | f920d5e07c29a9aa1b77d9b88bd604cf1a1f3664 (diff) | |
parent | 00e27c78d3d2de6964096ceee8d70e5b487365e3 (diff) | |
download | nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.gz nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.bz2 nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.lz nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.xz nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.zst nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.zip |
Merge commit '00e27c78d3d2de6964096ceee8d70e5b487365e3'
Conflicts: nixpkgs/nixos/modules/system/boot/systemd.nix nixpkgs/pkgs/applications/networking/browsers/firefox/common.nix nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/common.nix nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/default.nix nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/pink.nix nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/applications/virtualization/crosvm/update.py')
-rwxr-xr-x | nixpkgs/pkgs/applications/virtualization/crosvm/update.py | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/nixpkgs/pkgs/applications/virtualization/crosvm/update.py b/nixpkgs/pkgs/applications/virtualization/crosvm/update.py index 29e68b9f5790..6e36e524b78d 100755 --- a/nixpkgs/pkgs/applications/virtualization/crosvm/update.py +++ b/nixpkgs/pkgs/applications/virtualization/crosvm/update.py @@ -12,9 +12,7 @@ from lxml import etree from lxml.etree import HTMLParser from urllib.request import urlopen -# ChromiumOS components required to build crosvm. -components = ['chromiumos/platform/crosvm', 'chromiumos/third_party/adhd'] - +git_path = 'chromiumos/platform/crosvm' git_root = 'https://chromium.googlesource.com/' manifest_versions = f'{git_root}chromiumos/manifest-versions' buildspecs_url = f'{manifest_versions}/+/refs/heads/master/full/buildspecs/' @@ -54,32 +52,27 @@ with urlopen(f'{buildspecs_url}{chrome_major_version}/?format=TEXT') as resp: buildspecs.sort(reverse=True) buildspec = splitext(buildspecs[0])[0] -revisions = {} - -# Read the buildspec, and extract the git revisions for each component. +# Read the buildspec, and extract the git revision. with urlopen(f'{buildspecs_url}{chrome_major_version}/{buildspec}.xml?format=TEXT') as resp: xml = base64.decodebytes(resp.read()) root = etree.fromstring(xml) - for project in root.findall('project'): - revisions[project.get('name')] = project.get('revision') + revision = root.find(f'./project[@name="{git_path}"]').get('revision') # Initialize the data that will be output from this script. Leave the # rc number in buildspec so nobody else is subject to the same level # of confusion I have been. -data = {'version': f'{chrome_major_version}.{buildspec}', 'components': {}} - -# Fill in the 'components' dictionary with the output from -# nix-prefetch-git, which can be passed straight to fetchGit when -# imported by Nix. -for component in components: - argv = ['nix-prefetch-git', - '--url', git_root + component, - '--rev', revisions[component]] +data = {'version': f'{chrome_major_version}.{buildspec}'} - output = subprocess.check_output(argv) - data['components'][component] = json.loads(output.decode('utf-8')) +# Fill in the 'src' key with the output from nix-prefetch-git, which +# can be passed straight to fetchGit when imported by Nix. +argv = ['nix-prefetch-git', + '--fetch-submodules', + '--url', git_root + git_path, + '--rev', revision] +output = subprocess.check_output(argv) +data['src'] = json.loads(output.decode('utf-8')) -# Find the path to crosvm's default.nix, so the srcs data can be +# Find the path to crosvm's default.nix, so the src data can be # written into the same directory. argv = ['nix-instantiate', '--eval', '--json', '-A', 'crosvm.meta.position'] position = json.loads(subprocess.check_output(argv).decode('utf-8')) |