Commit 728a278f authored by Jérome Perrin's avatar Jérome Perrin

software/theia: download extensions using slapos.recipe.build 's download

slapos.recipe.build verifies signatures of downloaded files and can also use
buildout cache or download from shacache, which

This introduces a new download-plugins.cfg, containing the URLs of
extensions and their md5sum signatures. This profile is extended by
software.cfg and there's a section using slapos.recipe.build to actually
download extensions.

A generate_download_plugins_cfg.py python script is also included, to be
run by software release maintainers to update download-plugins.cfg using the
list of plugins included in generate_download_plugins_cfg.py
parent a22fcd09
This diff is collapsed.
import configparser
import requests
import hashlib
urls = []
for plugin_and_version in '''\
vscode/bat/1.44.2
vscode/clojure/1.44.2
vscode/coffeescript/1.44.2
vscode/configuration-editing/1.44.2
vscode/cpp/1.44.2
vscode/csharp/1.44.2
vscode/css/1.44.2
vscode/css-language-features/1.45.1
vscode/debug-auto-launch/1.44.2
vscode/docker/1.44.2
vscode/emmet/1.44.2
vscode/fsharp/1.44.2
vscode/go/1.44.2
vscode/groovy/1.44.2
vscode/grunt/1.44.2
vscode/gulp/1.44.2
vscode/handlebars/1.44.2
vscode/hlsl/1.44.2
vscode/html/1.48.0-next.4a1bcdafe9
vscode/html-language-features/1.48.0-next.4a1bcdafe9
vscode/ini/1.44.2
vscode/jake/1.44.2
vscode/java/1.44.2
vscode/javascript/1.44.2
ms-vscode/js-debug/1.49.8
vscode/json/1.46.1
vscode/json-language-features/1.46.1
vscode/less/1.44.2
vscode/log/1.44.2
vscode/lua/1.44.2
vscode/make/1.44.2
vscode/markdown/1.44.2
vscode/markdown-language-features/1.39.1
vscode/merge-conflict/1.44.2
vscode/npm/1.44.2
ms-vscode/node-debug/1.44.8
ms-vscode/node-debug2/1.42.1
vscode/objective-c/1.44.2
vscode/perl/1.44.2
vscode/powershell/1.44.2
vscode/pug/1.44.2
vscode/python/1.44.2
vscode/r/1.44.2
vscode/razor/1.44.2
vscode/ruby/1.44.2
vscode/rust/1.44.2
vscode/scss/1.44.2
vscode/shaderlab/1.44.2
vscode/shellscript/1.44.2
vscode/sql/1.44.2
vscode/swift/1.44.2
vscode/theme-abyss/1.44.2
vscode/theme-defaults/1.44.2
vscode/theme-kimbie-dark/1.44.2
vscode/theme-monokai/1.44.2
vscode/theme-monokai-dimmed/1.44.2
vscode/theme-quietlight/1.44.2
vscode/theme-red/1.44.2
vscode/theme-solarized-dark/1.44.2
vscode/theme-tomorrow-night-blue/1.44.2
vscode/typescript/1.44.2
vscode/typescript-language-features/1.44.2
vscode/vb/1.44.2
vscode/vscode-theme-seti/1.44.2
vscode/xml/1.44.2
vscode/yaml/1.44.2
EditorConfig/EditorConfig/0.14.4
dbaeumer/vscode-eslint/2.1.1
ms-vscode/references-view/0.0.47
golang/Go/0.16.2
vscjava/vscode-java-debug/0.29.0
redhat/java/0.61.0
vscjava/vscode-java-test/0.26.0
ms-python/python/2020.9.112786
perrinjerome/vscode-zc-buildout/0.4.0
jebbs/plantuml/2.13.12
rafaelmaiolla/diff/0.0.1
perrinjerome/git-commit-syntax/0.0.1
perrinjerome/git-rebase-syntax/0.0.1
'''.splitlines():
plugin_and_version = plugin_and_version.strip()
if not plugin_and_version or plugin_and_version.startswith('#'):
continue
publisher, extension_name, version = plugin_and_version.split('/')
api_url = f'https://open-vsx.org/api/{publisher}/{extension_name}/{version}'
download_url = requests.get(api_url).json()['files']['download']
md5sum = hashlib.md5(requests.get(download_url).content).hexdigest()
urls.append(f'{publisher}-{extension_name} {download_url} {md5sum}')
cfg = configparser.ConfigParser()
cfg.add_section('theia-download-plugins')
cfg.set('theia-download-plugins', 'urls', '\n'.join(urls))
with open('download-plugins.cfg', 'w') as f:
f.write(f"""\
# This file is automatically generated from {__file__}
# Do not edit directly.
""")
cfg.write(f)
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment