Scoop
Scoop copied to clipboard
Fix-autoupdate: Remove unnecessary architectures to prevent download errors and improve hash speed.
This pull request aims to solve issue https://github.com/ScoopInstaller/Scoop/issues/5582, by removing useless architecture property from $Manifest and $Manifest.autoupdate. The user generated manifest can be found in "$ScoopDir\workspace" directory. It seems this change does not influence any other scoop functions, and should work as expect.
The motivation is that user generated manifest don't need too manyredundant architecture information. It's generated for current machine in most situations.
Before (manifest contains architecture):
{
"version": "23.11.0",
"description": "An asynchronous event driven JavaScript runtime designed to build scalable network applications.",
"homepage": "https://nodejs.org",
"license": "MIT",
"architecture": {
"64bit": {
"url": "https://nodejs.org/dist/v23.11.0/node-v23.11.0-win-x64.7z",
"hash": "35f424f7eadbbbcd6e65a841f994b231e42f790e2ad2727b196f2d194f9ab993",
"extract_dir": "node-v23.11.0-win-x64"
},
"arm64": {
"url": "https://nodejs.org/dist/v23.11.0/node-v23.11.0-win-arm64.7z",
"hash": "3635315a6d8d2d51ef466ea7b9c6b32b2f9f00a04c3e70cf01e16a44e26396ca",
"extract_dir": "node-v23.11.0-win-arm64"
}
},
"persist": [
"bin",
"cache"
],
"env_add_path": [
"bin",
"."
],
"post_install": [
"# Set npm prefix to install modules inside bin and npm cache so they persist",
"Set-Content -Value \"prefix=$persist_dir\\bin`ncache=$persist_dir\\cache\" -Path \"$dir\\node_modules\\npm\\npmrc\""
],
"checkver": {
"url": "https://nodejs.org/dist/index.json",
"jsonpath": "$[0].version",
"regex": "v([\\d.]+)"
},
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://nodejs.org/dist/v$version/node-v$version-win-x64.7z",
"extract_dir": "node-v$version-win-x64"
},
"arm64": {
"url": "https://nodejs.org/dist/v$version/node-v$version-win-arm64.7z",
"extract_dir": "node-v$version-win-arm64"
}
},
"hash": {
"url": "$baseurl/SHASUMS256.txt.asc"
}
}
}
After (manifest without architecture):
{
"version": "14.21.3",
"description": "An asynchronous event driven JavaScript runtime designed to build scalable network applications.",
"homepage": "https://nodejs.org",
"license": "MIT",
"url": "https://nodejs.org/dist/v14.21.3/node-v14.21.3-win-x64.7z",
"hash": "a00c71e662cb1752f180e54921ca2c79bdefc7200a51b8805888ac3723889579",
"extract_dir": "node-v14.21.3-win-x64",
"persist": [
"bin",
"cache"
],
"env_add_path": [
"bin",
"."
],
"post_install": [
"# Set npm prefix to install modules inside bin and npm cache so they persist",
"Set-Content -Value \"prefix=$persist_dir\\bin`ncache=$persist_dir\\cache\" -Path \"$dir\\node_modules\\npm\\npmrc\""
],
"checkver": {
"url": "https://nodejs.org/dist/index.json",
"jsonpath": "$[0].version",
"regex": "v([\\d.]+)"
},
"autoupdate": {
"url": "https://nodejs.org/dist/v$version/node-v$version-win-x64.7z",
"extract_dir": "node-v$version-win-x64",
"hash": {
"url": "$baseurl/SHASUMS256.txt.asc"
}
}
}