diff --git a/CHANGELOG.md b/CHANGELOG.md index c0c15ec326..3795ce5dc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [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)) +- **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/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 ### Features 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 '' } } 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") } } 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-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" } 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 diff --git a/libexec/scoop-update.ps1 b/libexec/scoop-update.ps1 index 9d41906eca..7c0163172a 100644 --- a/libexec/scoop-update.ps1 +++ b/libexec/scoop-update.ps1 @@ -75,7 +75,7 @@ function Sync-Scoop { if (!(Test-GitAvailable)) { abort "Scoop uses Git to update itself. Run 'scoop install git' and try again." } Write-Host 'Updating Scoop...' - $currentdir = versiondir 'scoop' 'current' + $currentdir = Convert-Path (versiondir 'scoop' 'current') if (!(Test-Path "$currentdir\.git")) { $newdir = "$currentdir\..\new" $olddir = "$currentdir\..\old"