From 691c23330c45e912e1e01f071d03ed640399a14c Mon Sep 17 00:00:00 2001 From: AkariiinMKII <6019344+AkariiinMKII@users.noreply.github.com> Date: Thu, 14 Aug 2025 17:51:19 +0800 Subject: [PATCH 01/10] fix(scoop-download): Fix function `nightly_version` not defined error (#6386) --- CHANGELOG.md | 6 ++++++ libexec/scoop-download.ps1 | 1 + 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0c15ec326..ffe2a7fbf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [Unreleased](https://github.com/ScoopInstaller/Scoop/compare/v0.5.3...develop) + +### Bug Fixes + +- **scoop-download**: Fix function `nightly_version` not defined error ([#6386](https://github.com/ScoopInstaller/Scoop/issues/6386)) + ## [v0.5.3](https://github.com/ScoopInstaller/Scoop/compare/v0.5.2...v0.5.3) - 2025-08-11 ### Features diff --git a/libexec/scoop-download.ps1 b/libexec/scoop-download.ps1 index 996cb4e8e6..34a78ea952 100644 --- a/libexec/scoop-download.ps1 +++ b/libexec/scoop-download.ps1 @@ -25,6 +25,7 @@ . "$PSScriptRoot\..\lib\versions.ps1" # 'Select-CurrentVersion' . "$PSScriptRoot\..\lib\manifest.ps1" # 'generate_user_manifest' 'Get-Manifest' . "$PSScriptRoot\..\lib\download.ps1" +. "$PSScriptRoot\..\lib\install.ps1" # 'nightly_version' if (get_config USE_SQLITE_CACHE) { . "$PSScriptRoot\..\lib\database.ps1" } From c9f0728ff7cab879fc0adecad319816c5aded95b Mon Sep 17 00:00:00 2001 From: HUMORCE Date: Wed, 20 Aug 2025 13:59:47 +0800 Subject: [PATCH 02/10] fix(autoupdate): Use origin url to handle urls with fragment in github mode (#6455) --- CHANGELOG.md | 1 + lib/autoupdate.ps1 | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffe2a7fbf9..279c76d947 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Bug Fixes - **scoop-download**: Fix function `nightly_version` not defined error ([#6386](https://github.com/ScoopInstaller/Scoop/issues/6386)) +- **autoupdate:** Use origin URL to handle URLs with fragment in GitHub mode ([#6455](https://github.com/ScoopInstaller/Scoop/issues/6455)) ## [v0.5.3](https://github.com/ScoopInstaller/Scoop/compare/v0.5.2...v0.5.3) - 2025-08-11 diff --git a/lib/autoupdate.ps1 b/lib/autoupdate.ps1 index 711f2fd6e5..fbc3ebfdee 100644 --- a/lib/autoupdate.ps1 +++ b/lib/autoupdate.ps1 @@ -3,6 +3,8 @@ function format_hash([String] $hash) { $hash = $hash.toLower() + # Workaround for GitHub API: + # `"digest": "sha256:"` if ($hash -like 'sha256:*') { $hash = $hash.Substring(7) # Remove prefix 'sha256:' } @@ -209,13 +211,14 @@ function get_hash_for_app([String] $app, $config, [String] $version, [String] $u $hash = $null $hashmode = $config.mode + $originurl = strip_fragment $url $basename = [System.Web.HttpUtility]::UrlDecode((url_remote_filename($url))) $substitutions = $substitutions.Clone() - $substitutions.Add('$url', (strip_fragment $url)) - $substitutions.Add('$baseurl', (strip_filename (strip_fragment $url)).TrimEnd('/')) + $substitutions.Add('$url', $originurl) + $substitutions.Add('$baseurl', (strip_filename $originurl).TrimEnd('/')) $substitutions.Add('$basename', $basename) - $substitutions.Add('$urlNoExt', (strip_ext (strip_fragment $url))) + $substitutions.Add('$urlNoExt', (strip_ext $originurl)) $substitutions.Add('$basenameNoExt', (strip_ext $basename)) debug $substitutions @@ -297,7 +300,7 @@ function get_hash_for_app([String] $app, $config, [String] $version, [String] $u } 'github' { $hashfile_url = "https://api.github.com/repos/$($matches['owner'])/$($matches['repo'])/releases" - $hash = find_hash_in_json $hashfile_url $substitutions ("$..assets[?(@.browser_download_url == '" + $url + "')].digest") + $hash = find_hash_in_json $hashfile_url $substitutions ("$..assets[?(@.browser_download_url == '" + $originurl + "')].digest") } } From ff38652e0126d8a86b1f935dbb2e69299061e4dc Mon Sep 17 00:00:00 2001 From: z-Fng <54583083+z-Fng@users.noreply.github.com> Date: Thu, 21 Aug 2025 14:18:33 +0800 Subject: [PATCH 03/10] fix(buckets|scoop-info): Switch git log date format to ISO 8601 to avoid locale issues (#6446) --- CHANGELOG.md | 1 + lib/buckets.ps1 | 2 +- libexec/scoop-info.ps1 | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 279c76d947..800b03097c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - **scoop-download**: Fix function `nightly_version` not defined error ([#6386](https://github.com/ScoopInstaller/Scoop/issues/6386)) - **autoupdate:** Use origin URL to handle URLs with fragment in GitHub mode ([#6455](https://github.com/ScoopInstaller/Scoop/issues/6455)) +- **buckets|scoop-info:** Switch git log date format to ISO 8601 to avoid locale issues ([#6446](https://github.com/ScoopInstaller/Scoop/pull/6446)) ## [v0.5.3](https://github.com/ScoopInstaller/Scoop/compare/v0.5.2...v0.5.3) - 2025-08-11 diff --git a/lib/buckets.ps1 b/lib/buckets.ps1 index 87bc02d287..08d6d0bd7e 100644 --- a/lib/buckets.ps1 +++ b/lib/buckets.ps1 @@ -108,7 +108,7 @@ function list_buckets { $path = Find-BucketDirectory $_ -Root if ((Test-Path (Join-Path $path '.git')) -and (Get-Command git -ErrorAction SilentlyContinue)) { $bucket.Source = Invoke-Git -Path $path -ArgumentList @('config', 'remote.origin.url') - $bucket.Updated = Invoke-Git -Path $path -ArgumentList @('log', '--format=%aD', '-n', '1') | Get-Date + $bucket.Updated = Invoke-Git -Path $path -ArgumentList @('log', '--format=%aI', '-n', '1') | Get-Date } else { $bucket.Source = friendly_path $path $bucket.Updated = (Get-Item "$path\bucket" -ErrorAction SilentlyContinue).LastWriteTime diff --git a/libexec/scoop-info.ps1 b/libexec/scoop-info.ps1 index 1322e33a63..1c147e17c0 100644 --- a/libexec/scoop-info.ps1 +++ b/libexec/scoop-info.ps1 @@ -122,7 +122,7 @@ if ($manifest.depends) { if (Test-Path $manifest_file) { if (Get-Command git -ErrorAction Ignore) { - $gitinfo = (Invoke-Git -Path (Split-Path $manifest_file) -ArgumentList @('log', '-1', '-s', '--format=%aD#%an', $manifest_file) 2> $null) -Split '#' + $gitinfo = (Invoke-Git -Path (Split-Path $manifest_file) -ArgumentList @('log', '-1', '-s', '--format=%aI#%an', $manifest_file) 2> $null) -Split '#' } if ($gitinfo) { $item.'Updated at' = $gitinfo[0] | Get-Date From 04b7ce79c7a1395f5db0141bf247a29d92873515 Mon Sep 17 00:00:00 2001 From: z-Fng <54583083+z-Fng@users.noreply.github.com> Date: Wed, 27 Aug 2025 05:46:16 -0400 Subject: [PATCH 04/10] fix(scoop-version): Fix logic error caused by missing brackets (#6463) --- CHANGELOG.md | 5 +++-- bin/scoop.ps1 | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 800b03097c..3795ce5dc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,10 @@ ### Bug Fixes -- **scoop-download**: Fix function `nightly_version` not defined error ([#6386](https://github.com/ScoopInstaller/Scoop/issues/6386)) +- **scoop-download:** Fix function `nightly_version` not defined error ([#6386](https://github.com/ScoopInstaller/Scoop/issues/6386)) - **autoupdate:** Use origin URL to handle URLs with fragment in GitHub mode ([#6455](https://github.com/ScoopInstaller/Scoop/issues/6455)) -- **buckets|scoop-info:** Switch git log date format to ISO 8601 to avoid locale issues ([#6446](https://github.com/ScoopInstaller/Scoop/pull/6446)) +- **buckets|scoop-info:** Switch git log date format to ISO 8601 to avoid locale issues ([#6446](https://github.com/ScoopInstaller/Scoop/issues/6446)) +- **scoop-version:** Fix logic error caused by missing brackets ([#6463](https://github.com/ScoopInstaller/Scoop/issues/6463)) ## [v0.5.3](https://github.com/ScoopInstaller/Scoop/compare/v0.5.2...v0.5.3) - 2025-08-11 diff --git a/bin/scoop.ps1 b/bin/scoop.ps1 index fd2fd41fa7..036a05ba29 100644 --- a/bin/scoop.ps1 +++ b/bin/scoop.ps1 @@ -20,8 +20,8 @@ switch ($subCommand) { } ({ $subCommand -in @('-v', '--version') }) { Write-Host 'Current Scoop version:' - if (Test-GitAvailable -and (Test-Path "$PSScriptRoot\..\.git") -and (get_config SCOOP_BRANCH 'master') -ne 'master') { - Invoke-Git -Path "$PSScriptRoot\.." -ArgumentList @('log', 'HEAD', '-1', '--oneline') + if ((Test-GitAvailable) -and (Test-Path "$PSScriptRoot\..\.git") -and ((get_config SCOOP_BRANCH 'master') -ne 'master')) { + Invoke-Git -Path "$PSScriptRoot\.." -ArgumentList @('--no-pager', 'log', 'HEAD', '-1', '--oneline') } else { $version = Select-String -Pattern '^## \[(v[\d.]+)\].*?([\d-]+)$' -Path "$PSScriptRoot\..\CHANGELOG.md" Write-Host $version.Matches.Groups[1].Value -ForegroundColor Cyan -NoNewline @@ -31,9 +31,9 @@ switch ($subCommand) { Get-LocalBucket | ForEach-Object { $bucketLoc = Find-BucketDirectory $_ -Root - if (Test-GitAvailable -and (Test-Path "$bucketLoc\.git")) { + if ((Test-GitAvailable) -and (Test-Path "$bucketLoc\.git")) { Write-Host "'$_' bucket:" - Invoke-Git -Path $bucketLoc -ArgumentList @('log', 'HEAD', '-1', '--oneline') + Invoke-Git -Path $bucketLoc -ArgumentList @('--no-pager', 'log', 'HEAD', '-1', '--oneline') Write-Host '' } } From 1e3e81afc9ca025f39f4a49d54639309500a1c3d Mon Sep 17 00:00:00 2001 From: Capella87 Date: Tue, 16 Sep 2025 21:29:05 +0900 Subject: [PATCH 05/10] feat(checkver): Add GitLab support --- bin/checkver.ps1 | 18 ++++++++++++++++++ schema.json | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/bin/checkver.ps1 b/bin/checkver.ps1 index 33a4449488..5ef97ba020 100644 --- a/bin/checkver.ps1 +++ b/bin/checkver.ps1 @@ -162,6 +162,24 @@ $Queue | ForEach-Object { if ($json.checkver.PSObject.Properties.Count -eq 1) { $useGithubAPI = $true } } + # GitLab + if ($regex) { + $gitlabRegex = $regex + } else { + $regex = '/-/tags/(?:v|V)?([\d.]+)' + } + if ($json.checkver -eq 'gitlab') { + if (!$json.homepage.StartsWith('https://gitlab.com/')) { + error "$name checkvar expects the homepage to be a GitLab" + } + $url = $json.checkver.gitlab.TrimEnd('/') + '/-/tags?format=atom' + $regex = $gitlabRegex + } + if ($json.checkver.gitlab) { + $url = $json.checkver.gitlab.TrimEnd('/') + '/-/tags?format=atom' + $regex = $gitlabRegex + } + # SourceForge if ($regex) { $sourceforgeRegex = $regex diff --git a/schema.json b/schema.json index 6c24d4da20..9b7799e578 100644 --- a/schema.json +++ b/schema.json @@ -292,6 +292,10 @@ "format": "uri", "type": "string" }, + "gitlab": { + "format": "url", + "type": "string" + }, "re": { "format": "regex", "type": "string", From d7bda91d62c5d42fb910fcc42c196791fa1c7063 Mon Sep 17 00:00:00 2001 From: Capella87 Date: Wed, 17 Sep 2025 12:15:03 +0900 Subject: [PATCH 06/10] fix(checkver): Make regex check releases instead of tags --- bin/checkver.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/checkver.ps1 b/bin/checkver.ps1 index 5ef97ba020..cf822bad11 100644 --- a/bin/checkver.ps1 +++ b/bin/checkver.ps1 @@ -166,17 +166,17 @@ $Queue | ForEach-Object { if ($regex) { $gitlabRegex = $regex } else { - $regex = '/-/tags/(?:v|V)?([\d.]+)' + $gitlabRegex = '/-/releases/(?:v|V)?([\d.]+)' } if ($json.checkver -eq 'gitlab') { if (!$json.homepage.StartsWith('https://gitlab.com/')) { error "$name checkvar expects the homepage to be a GitLab" } - $url = $json.checkver.gitlab.TrimEnd('/') + '/-/tags?format=atom' + $url = $json.checkver.gitlab.TrimEnd('/') + '/-/releases?format=atom' $regex = $gitlabRegex } if ($json.checkver.gitlab) { - $url = $json.checkver.gitlab.TrimEnd('/') + '/-/tags?format=atom' + $url = $json.checkver.gitlab.TrimEnd('/') + '/-/releases?format=atom' $regex = $gitlabRegex } From 95056764870a0d30cfe4383fb84131301f595e49 Mon Sep 17 00:00:00 2001 From: Capella87 Date: Wed, 17 Sep 2025 13:41:27 +0900 Subject: [PATCH 07/10] chore(changelog): Add the change --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3795ce5dc3..59d6f9217b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ - **buckets|scoop-info:** Switch git log date format to ISO 8601 to avoid locale issues ([#6446](https://github.com/ScoopInstaller/Scoop/issues/6446)) - **scoop-version:** Fix logic error caused by missing brackets ([#6463](https://github.com/ScoopInstaller/Scoop/issues/6463)) +### Features + +**checkver**: Add GitLab to `checkver` ([#5508](https://github.com/ScoopInstaller/Scoop/issues/5508)) + ## [v0.5.3](https://github.com/ScoopInstaller/Scoop/compare/v0.5.2...v0.5.3) - 2025-08-11 ### Features From 8c7aba3aa6d8550333d0863012771f7b86fa2c33 Mon Sep 17 00:00:00 2001 From: Capella87 Date: Wed, 17 Sep 2025 14:13:40 +0900 Subject: [PATCH 08/10] fix(checkver): A typo in error message --- bin/checkver.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/checkver.ps1 b/bin/checkver.ps1 index cf822bad11..2e2da23f6d 100644 --- a/bin/checkver.ps1 +++ b/bin/checkver.ps1 @@ -170,7 +170,7 @@ $Queue | ForEach-Object { } if ($json.checkver -eq 'gitlab') { if (!$json.homepage.StartsWith('https://gitlab.com/')) { - error "$name checkvar expects the homepage to be a GitLab" + error "$name checkver expects the homepage to be a GitLab" } $url = $json.checkver.gitlab.TrimEnd('/') + '/-/releases?format=atom' $regex = $gitlabRegex From b5ddf9503172761a447dac5507f443abd89976df Mon Sep 17 00:00:00 2001 From: Capella87 Date: Wed, 17 Sep 2025 14:17:16 +0900 Subject: [PATCH 09/10] fix(schema): Format of `gitlab` to `uri` --- schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema.json b/schema.json index 9b7799e578..af51c94d0a 100644 --- a/schema.json +++ b/schema.json @@ -293,7 +293,7 @@ "type": "string" }, "gitlab": { - "format": "url", + "format": "uri", "type": "string" }, "re": { From 781b2faee3b184af4db3da2531f9aa6b86d96744 Mon Sep 17 00:00:00 2001 From: Capella87 Date: Wed, 17 Sep 2025 14:19:30 +0900 Subject: [PATCH 10/10] fix(checkver): Update error message more clearly --- bin/checkver.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/checkver.ps1 b/bin/checkver.ps1 index 2e2da23f6d..f1bed57c1c 100644 --- a/bin/checkver.ps1 +++ b/bin/checkver.ps1 @@ -170,7 +170,7 @@ $Queue | ForEach-Object { } if ($json.checkver -eq 'gitlab') { if (!$json.homepage.StartsWith('https://gitlab.com/')) { - error "$name checkver expects the homepage to be a GitLab" + error "$name checkver expects the homepage to be a GitLab repository" } $url = $json.checkver.gitlab.TrimEnd('/') + '/-/releases?format=atom' $regex = $gitlabRegex