Scoop
Scoop copied to clipboard
Feature Request: Reuse checkver JSON, XML objects in autoupdate
Consider the following manifest:
"checkver": {
"url": "https://api.adoptopenjdk.net/v3/assets/feature_releases/14/ga?jvm_impl=hotspot&heap_size=normal&os=windows&image_type=jdk&project=jdk&vendor=adoptopenjdk&page_size=1&sort_order=DESC",
"jsonpath": "$..version_data.samver"
},
"autoupdate": {
"architecture": {
"64bit": {
"url": {
"mode": "json",
"jsonpath": "$..binaries[?(@.architecture == 'x64')].package.link"
},
"hash": {
"mode": "json",
"jsonpath": "$..binaries[?(@.architecture == 'x64')].package.checksum"
}
},
[...]
- Since we don't provide a new
urlinautoupdate, thecheckverurlis reused. urluses same modes ashash, for flexibility, eg hashmodemight bestring, while urlmodemight bejson.- no
versionparsing required forurl.
A different proposal
To make "checkver" an array. "$version" will match the last unnamed (or named as "version") capture; other fields will match named captures.
"checkver": [
{
"url": "https://domain/version_api",
"jsonpath": "$..version_data.samver"
},
{
"url": "https://domain/download_api",
"jsonpath": "$..binaries[?(@.architecture == 'x64')].package.link",
"regex": "(?<link>.+)"
},
{
// omit to re-use previous url
"jsonpath": "$..binaries[?(@.architecture == 'x64')].package.checksum",
"regex": "(?<checksum>.+)"
}
],
"autoupdate": {
"url": "$matchLink",
"hash": "$matchChecksum"
}