Skip to content

Commit ebd8c03

Browse files
niheaveno-l-a-vkiennqHUMORCEsitiom
authored
chore(release): Bump to version 0.5.3 (#6257)
* fix (decompress): `Expand-7zipArchive` only delete temp dir / `$extractDir` if it is empty (#6092) Co-authored-by: Hsiao-nan Cheung <[email protected]> * refactor(download): Move download-related functions to 'download.ps1' (#6095) * fix(download): Fallback to default downloader when aria2 fails (#4292) * fix(commands): Handling broken aliases (#6141) * fix(shim): properly check `wslpath`/`cygpath` command first (#6114) Co-authored-by: Hsiao-nan Cheung <[email protected]> * fix(scoop-bucket): Add missing import for `no_junction` envs (#6181) Signed-off-by: Chawye Hsu <[email protected]> * docs(chglog): Update to 0.5.3 (#6258) * perf(shim): Update kiennq-shim to v3.1.2 (#6261) * fix(decompress): Replace deprecated 7ZIPEXTRACT_USE_EXTERNAL config (#6327) Co-authored-by: Hsiao-nan Cheung <[email protected]> * fix(scoop-uninstall): Fix uninstaller does not gain Global state (#6430) * global arg * changelog * refactor(Get-Manifest): Select actual source for manifest (#6142) * first step * Revert "first step" This reverts commit c5907c3. * refactor(Get-Manifest): Select actual source for installed manifest * rework sub-commands, `scoop-depends` is NOT working at this stage * URI manifest * opt * deprecated manifest * source of manifests * source of manifest pt2 - Mark URI(path/URL/UNC/etc.) query as standalone manifest - Drop `installed` and `available update` items for [query] and [installed] are different sources. * remove variable preventing I forget it * scoop-info: fix source of manifest on bucket * fix `scoop-depends` * Fix Standalone and Source detection * fix global install * Fix scoop-cat, scoop-home - Query for remote manifest * scoop-list: info +deprecated * manifest: Fix first selected manifest * gramma.. * Fix 61b3259 * length * fix(scoop-depends-tests): Mocking `USE_EXTERNAL_7ZIP` as $false (#6431) * fix(scoop-depends-tests): Mocking `USE_EXTERNAL_7ZIP` as $false to avoding error when it is $true * CHANGELOG * feat(autoupdate): GitHub predefined hashes support (#6416) * feat(autoupdate): predefined hash case for GitHub - Remove `sha256:` prefix in `format_hash()` - Add GitHub support in `get_hash_for_app()` Close #6381 * doc(chglog): GitHub auto hash update * fix(autoupdate): remove prefix only * docs(CHANGELOG): Update to 0.5.3 (#6432) * docs(CHANGELOG): Update to 0.5.3 * 6416 --------- Signed-off-by: Chawye Hsu <[email protected]> Co-authored-by: Olav Rønnestad Birkeland <[email protected]> Co-authored-by: kiennq <[email protected]> Co-authored-by: HUMORCE <[email protected]> Co-authored-by: Ryan <[email protected]> Co-authored-by: Chawye Hsu <[email protected]> Co-authored-by: Bassel Rachid <[email protected]> Co-authored-by: Wordless Echo <[email protected]>
1 parent 859d1db commit ebd8c03

35 files changed

+1075
-877
lines changed

CHANGELOG.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
## [v0.5.3](https://github.com/ScoopInstaller/Scoop/compare/v0.5.2...v0.5.3) - 2025-08-11
2+
3+
### Features
4+
5+
**autoupdate:** GitHub predefined hashes support ([#6416](https://github.com/ScoopInstaller/Scoop/issues/6416))
6+
7+
### Bug Fixes
8+
9+
- **scoop-download|install|update:** Fallback to default downloader when aria2 fails ([#4292](https://github.com/ScoopInstaller/Scoop/issues/4292))
10+
- **decompress**: `Expand-7zipArchive` only delete temp dir / `$extractDir` if it is empty ([#6092](https://github.com/ScoopInstaller/Scoop/issues/6092))
11+
- **decompress**: Replace deprecated 7ZIPEXTRACT_USE_EXTERNAL config with USE_EXTERNAL_7ZIP ([#6327](https://github.com/ScoopInstaller/Scoop/issues/6327))
12+
- **commands**: Handling broken aliases ([#6141](https://github.com/ScoopInstaller/Scoop/issues/6141))
13+
- **shim:** Do not suppress `stderr`, properly check `wslpath`/`cygpath` command first ([#6114](https://github.com/ScoopInstaller/Scoop/issues/6114))
14+
- **scoop-bucket:** Add missing import for `no_junction` envs ([#6181](https://github.com/ScoopInstaller/Scoop/issues/6181))
15+
- **scoop-uninstall:** Fix uninstaller does not gain Global state ([#6430](https://github.com/ScoopInstaller/Scoop/issues/6430))
16+
- **scoop-depends-tests:** Mocking `USE_EXTERNAL_7ZIP` as $false to avoding error when it is $true ([#6431](https://github.com/ScoopInstaller/Scoop/issues/6431))
17+
18+
### Code Refactoring
19+
20+
- **download:** Move download-related functions to 'download.ps1' ([#6095](https://github.com/ScoopInstaller/Scoop/issues/6095))
21+
- **Get-Manifest:** Select actual source for manifest ([#6142](https://github.com/ScoopInstaller/Scoop/issues/6142))
22+
23+
### Performance Improvements
24+
25+
- **shim:** Update kiennq-shim to v3.1.2 ([#6261](https://github.com/ScoopInstaller/Scoop/issues/6261))
26+
127
## [v0.5.2](https://github.com/ScoopInstaller/Scoop/compare/v0.5.1...v0.5.2) - 2024-07-26
228

329
### Bug Fixes
@@ -40,7 +66,7 @@
4066
- **checkver:** Correct error messages ([#6024](https://github.com/ScoopInstaller/Scoop/issues/6024))
4167
- **core:** Search for Git executable instead of any cmdlet ([#5998](https://github.com/ScoopInstaller/Scoop/issues/5998))
4268
- **core:** Use correct path in 'bash' ([#6006](https://github.com/ScoopInstaller/Scoop/issues/6006))
43-
- **core:** Limit the number of commands to get when search for git executable ([#6013](https://github.com/ScoopInstaller/Scoop/pull/6013))
69+
- **core:** Limit the number of commands to get when search for git executable ([#6013](https://github.com/ScoopInstaller/Scoop/issues/6013))
4470
- **decompress:** Match `extract_dir`/`extract_to` and archives ([#5983](https://github.com/ScoopInstaller/Scoop/issues/5983))
4571
- **json:** Serialize jsonpath return ([#5921](https://github.com/ScoopInstaller/Scoop/issues/5921))
4672
- **shim:** Restore original path for JAR cmd ([#6030](https://github.com/ScoopInstaller/Scoop/issues/6030))

bin/checkhashes.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ param(
4646
. "$PSScriptRoot\..\lib\autoupdate.ps1"
4747
. "$PSScriptRoot\..\lib\json.ps1"
4848
. "$PSScriptRoot\..\lib\versions.ps1"
49-
. "$PSScriptRoot\..\lib\install.ps1"
49+
. "$PSScriptRoot\..\lib\download.ps1"
5050

5151
$Dir = Convert-Path $Dir
5252
if ($ForceUpdate) { $Update = $true }

bin/checkurls.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ param(
2828

2929
. "$PSScriptRoot\..\lib\core.ps1"
3030
. "$PSScriptRoot\..\lib\manifest.ps1"
31-
. "$PSScriptRoot\..\lib\install.ps1"
31+
. "$PSScriptRoot\..\lib\download.ps1"
3232

3333
$Dir = Convert-Path $Dir
3434
$Queue = @()

bin/checkver.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ param(
7373
. "$PSScriptRoot\..\lib\buckets.ps1"
7474
. "$PSScriptRoot\..\lib\json.ps1"
7575
. "$PSScriptRoot\..\lib\versions.ps1"
76-
. "$PSScriptRoot\..\lib\install.ps1" # needed for hash generation
76+
. "$PSScriptRoot\..\lib\download.ps1"
7777

7878
if ($App -ne '*' -and (Test-Path $App -PathType Leaf)) {
7979
$Dir = Split-Path $App

bin/describe.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ param(
2323
. "$PSScriptRoot\..\lib\core.ps1"
2424
. "$PSScriptRoot\..\lib\manifest.ps1"
2525
. "$PSScriptRoot\..\lib\description.ps1"
26+
. "$PSScriptRoot\..\lib\download.ps1"
2627

2728
$Dir = Convert-Path $Dir
2829
$Queue = @()

lib/autoupdate.ps1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
# Must included with 'json.ps1'
2+
3+
function format_hash([String] $hash) {
4+
$hash = $hash.toLower()
5+
6+
if ($hash -like 'sha256:*') {
7+
$hash = $hash.Substring(7) # Remove prefix 'sha256:'
8+
}
9+
10+
switch ($hash.Length) {
11+
32 { $hash = "md5:$hash" } # md5
12+
40 { $hash = "sha1:$hash" } # sha1
13+
64 { $hash = $hash } # sha256
14+
128 { $hash = "sha512:$hash" } # sha512
15+
default { $hash = $null }
16+
}
17+
return $hash
18+
}
19+
220
function find_hash_in_rdf([String] $url, [String] $basename) {
321
$xml = $null
422
try {
@@ -246,6 +264,10 @@ function get_hash_for_app([String] $app, $config, [String] $version, [String] $u
246264
$hashmode = 'sourceforge'
247265
}
248266

267+
if ($url -match 'https:\/\/github\.com\/(?<owner>[^\/]+)\/(?<repo>[^\/]+)\/releases\/download\/[^\/]+\/[^\/]+') {
268+
$hashmode = 'github'
269+
}
270+
249271
switch ($hashmode) {
250272
'extract' {
251273
$hash = find_hash_in_textfile $hashfile_url $substitutions $regex
@@ -273,6 +295,10 @@ function get_hash_for_app([String] $app, $config, [String] $version, [String] $u
273295
$hashfile_url = (strip_filename (strip_fragment "https://sourceforge.net/projects/$($matches['project'])/files/$($matches['file'])")).TrimEnd('/')
274296
$hash = find_hash_in_textfile $hashfile_url $substitutions '"$basename":.*?"sha1":\s*"([a-fA-F0-9]{40})"'
275297
}
298+
'github' {
299+
$hashfile_url = "https://api.github.com/repos/$($matches['owner'])/$($matches['repo'])/releases"
300+
$hash = find_hash_in_json $hashfile_url $substitutions ("$..assets[?(@.browser_download_url == '" + $url + "')].digest")
301+
}
276302
}
277303

278304
if ($hash) {

lib/commands.ps1

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
function command_files {
66
(Get-ChildItem "$PSScriptRoot\..\libexec") + (Get-ChildItem "$scoopdir\shims") |
7-
Where-Object 'scoop-.*?\.ps1$' -Property Name -Match
7+
Where-Object 'scoop-.*?\.ps1$' -Property Name -Match
88
}
99

1010
function commands {
@@ -86,7 +86,9 @@ function rm_alias {
8686
}
8787

8888
info "Removing alias '$name'..."
89-
Remove-Item "$(shimdir $false)\scoop-$name.ps1"
89+
if (Test-Path "$(shimdir $false)\scoop-$name.ps1") {
90+
Remove-Item "$(shimdir $false)\scoop-$name.ps1"
91+
}
9092
$aliases.PSObject.Properties.Remove($name)
9193
set_config ALIAS $aliases | Out-Null
9294
}
@@ -98,11 +100,19 @@ function list_aliases {
98100

99101
$aliases = get_config ALIAS ([PSCustomObject]@{})
100102
$alias_info = $aliases.PSObject.Properties.Name | Where-Object { $_ } | ForEach-Object {
103+
# Mark the alias as <BROKEN>, if the alias script file does NOT exist.
104+
if (!(Test-Path "$(shimdir $false)\scoop-$_.ps1")) {
105+
[PSCustomObject]@{
106+
Name = $_
107+
Command = '<BROKEN>'
108+
}
109+
return
110+
}
101111
$content = Get-Content (command_path $_)
102112
[PSCustomObject]@{
103113
Name = $_
104-
Summary = (summary $content).Trim()
105114
Command = ($content | Select-Object -Skip 1).Trim()
115+
Summary = (summary $content).Trim()
106116
}
107117
}
108118
if (!$alias_info) {

0 commit comments

Comments
 (0)