Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): Bump to version 0.3.0 #5162

Merged
merged 20 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ec04dd0
feat(scoop-(un)hold): Support `scoop (un)hold scoop` (#5089)
yi-Xu-0100 Aug 11, 2022
bd12393
feat(scoop-update): Stash uncommitted changes before update (#5091)
niheaven Aug 11, 2022
8619ee7
feat(uninstall): Show the running processes (#5102)
yi-Xu-0100 Aug 15, 2022
a9e5a97
feat(scoop-config): Allow 'hold_update_until' be set manually (#5100)
niheaven Aug 16, 2022
08ecdd1
fix(config): Change config option to snake_case in file and SCREAMING…
niheaven Aug 21, 2022
dea9ebb
builds(schema): Set manifest schema to be stricter (#5093)
chawyehsu Aug 21, 2022
1985a05
refactor(path): Use 'Convert-Path()' instead of 'Resolve-Path()' (#5109)
niheaven Aug 22, 2022
e06c7f0
feat(getopt): Support option terminator (`--`) (#5121)
Aug 25, 2022
740322f
fix(psmodules): Remove folder recursively when unlinking previous mod…
AkariiinMKII Aug 29, 2022
5ad35d6
fix(jsonpath): Prevent converting date string to DateTime in JSONPath…
shiena Sep 9, 2022
bfef3d8
fix(scoop-update): Add uninstall_psmodule to update process (#5136)
AkariiinMKII Sep 9, 2022
6fc65ed
refactor(scoop-shim): Use `getopt` to parse arguments (#5125)
Sep 11, 2022
3730078
builds(vscode): Tweak VSCode setting (#5149)
niheaven Sep 16, 2022
122fdc1
refactor(download): Rename `dl()` to `Invoke-Download()` (#5143)
Sep 16, 2022
782f3f1
feat(checkurls): Allow checking URLs from private_hosts (#5152)
cesarcoatl Sep 16, 2022
04595b4
builds(checkver): Implement SourceForge checkver functionality (#5113)
niheaven Sep 26, 2022
146dab6
builds(schema): Remove 'object' from 'anyOf' under 'sourceforge' (#5163)
niheaven Sep 26, 2022
7a599f0
feat(install): Add support for ARM64 architecture (#5154)
rashil2000 Sep 27, 2022
7f47f66
feat(subdir): Allow subdir in 'bucket' (#5119)
niheaven Sep 28, 2022
9baf293
docs(changelog): Prepare for version 0.3.0 (#5167)
niheaven Oct 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ labels: "bug"

### System details

**Windows version:** [e.g. 7, 8, 10]
**Windows version:** [e.g. 7, 8, 10, 11]

**OS architecture:** [e.g. 32bit, 64bit]
**OS architecture:** [e.g. 32bit, 64bit, arm64]

**PowerShell version:** [output of `"$($PSVersionTable.PSVersion)"`]

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.log
.DS_Store
._.DS_Store
scoop.sublime-workspace
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"powershell.codeFormatting.preset": "OTBS",
"powershell.codeFormatting.alignPropertyValuePairs": true,
"powershell.codeFormatting.ignoreOneLineBlock": true,
"powershell.codeFormatting.useConstantStrings": true,
"powershell.codeFormatting.useCorrectCasing": true,
"powershell.codeFormatting.whitespaceBetweenParameters": true,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
## [v0.3.0](https://github.com/ScoopInstaller/Scoop/compare/v0.2.4...v0.3.0) - 2022-10-10

### Features

- **install:** Add support for ARM64 architecture ([#5154](https://github.com/ScoopInstaller/Scoop/issues/5154))
- **install:** Show the running process ([#5102](https://github.com/ScoopInstaller/Scoop/issues/5102))
- **getopt:** Support option terminator (`--`) ([#5121](https://github.com/ScoopInstaller/Scoop/issues/5121))
- **subdir:** Allow subdir in 'bucket' ([#5119](https://github.com/ScoopInstaller/Scoop/issues/5119))
- **scoop-config:** Allow 'hold_update_until' be set manually ([#5100](https://github.com/ScoopInstaller/Scoop/issues/5100))
- **scoop-(un)hold:** Support `scoop (un)hold scoop` ([#5089](https://github.com/ScoopInstaller/Scoop/issues/5089))
- **scoop-update:** Stash uncommitted changes before update ([#5091](https://github.com/ScoopInstaller/Scoop/issues/5091))

### Bug Fixes

- **config:** Change config option to snake_case in file and SCREAMING_CASE in code ([#5116](https://github.com/ScoopInstaller/Scoop/issues/5116))
- **jsonpath:** Prevent converting date string to DateTime in JSONPath ([#5130](https://github.com/ScoopInstaller/Scoop/issues/5130))
- **psmodule:** Remove folder recursively when unlinking previous module path ([#5127](https://github.com/ScoopInstaller/Scoop/issues/5127))
- **scoop-update:** Add `uninstall_psmodule` to update process ([#5136](https://github.com/ScoopInstaller/Scoop/issues/5136))

### Code Refactoring

- **download:** Rename `dl()` to `Invoke-Download()` ([#5143](https://github.com/ScoopInstaller/Scoop/issues/5143))
- **path:** Use 'Convert-Path()' instead of 'Resolve-Path()' ([#5109](https://github.com/ScoopInstaller/Scoop/issues/5109))
- **scoop-shim:** Use `getopt` to parse arguments ([#5125](https://github.com/ScoopInstaller/Scoop/issues/5125))

### Builds

- **checkver:** Implement SourceForge checkver functionality ([#5113](https://github.com/ScoopInstaller/Scoop/issues/5113), [#5163](https://github.com/ScoopInstaller/Scoop/issues/5163))
- **checkurls:** Allow checking URLs from private_hosts ([#5152](https://github.com/ScoopInstaller/Scoop/issues/5152))
- **schema:** Set manifest schema to be stricter ([#5093](https://github.com/ScoopInstaller/Scoop/issues/5093))
- **vscode:** Tweak VSCode setting ([#5149](https://github.com/ScoopInstaller/Scoop/issues/5149))

## [v0.2.4](https://github.com/ScoopInstaller/Scoop/compare/v0.2.3...v0.2.4) - 2022-08-08

### Features
Expand Down
2 changes: 1 addition & 1 deletion bin/auto-pr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ param(
if ($App -ne '*' -and (Test-Path $App -PathType Leaf)) {
$Dir = Split-Path $App
} elseif ($Dir) {
$Dir = Resolve-Path $Dir
$Dir = Convert-Path $Dir
} else {
throw "'-Dir' parameter required if '-App' is not a filepath!"
}
Expand Down
26 changes: 17 additions & 9 deletions bin/checkhashes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ param(
. "$PSScriptRoot\..\lib\install.ps1"
. "$PSScriptRoot\..\lib\unix.ps1"

$Dir = Resolve-Path $Dir
$Dir = Convert-Path $Dir
if ($ForceUpdate) { $Update = $true }
# Cleanup
if (!$UseCache) { Remove-Item "$cachedir\*HASH_CHECK*" -Force }
Expand All @@ -60,9 +60,10 @@ function err ([String] $name, [String[]] $message) {
}

$MANIFESTS = @()
foreach ($single in Get-ChildItem $Dir "$App.json") {
$name = (strip_ext $single.Name)
$manifest = parse_json "$Dir\$($single.Name)"
foreach ($single in Get-ChildItem $Dir -Filter "$App.json" -Recurse) {
$name = $single.BaseName
$file = $single.FullName
$manifest = parse_json $file

# Skip nighly manifests, since their hash validation is skipped
if ($manifest.version -eq 'nightly') { continue }
Expand All @@ -79,6 +80,8 @@ foreach ($single in Get-ChildItem $Dir "$App.json") {
hash $manifest '64bit' | ForEach-Object { $hashes += $_ }
script:url $manifest '32bit' | ForEach-Object { $urls += $_ }
hash $manifest '32bit' | ForEach-Object { $hashes += $_ }
script:url $manifest 'arm64' | ForEach-Object { $urls += $_ }
hash $manifest 'arm64' | ForEach-Object { $hashes += $_ }
} else {
err $name 'Manifest does not contain URL property.'
continue
Expand All @@ -92,6 +95,7 @@ foreach ($single in Get-ChildItem $Dir "$App.json") {

$MANIFESTS += @{
app = $name
file = $file
manifest = $manifest
urls = $urls
hashes = $hashes
Expand All @@ -113,7 +117,7 @@ foreach ($current in $MANIFESTS) {
$version = 'HASH_CHECK'
$tmp = $expected_hash -split ':'

dl_with_cache $current.app $version $_ $null $null -use_cache:$UseCache
Invoke-CachedDownload $current.app $version $_ $null $null -use_cache:$UseCache

$to_check = fullpath (cache_path $current.app $version $_)
$actual_hash = compute_hash $to_check $algorithm
Expand Down Expand Up @@ -158,23 +162,27 @@ foreach ($current in $MANIFESTS) {
# Defaults to zero, don't know, which architecture is available
$64bit_count = 0
$32bit_count = 0
$arm64_count = 0

# 64bit is get, donwloaded and added first
if ($platforms.Contains('64bit')) {
$64bit_count = $current.manifest.architecture.'64bit'.hash.Count
# 64bit is get, donwloaded and added first
$current.manifest.architecture.'64bit'.hash = $actuals[0..($64bit_count - 1)]
}
if ($platforms.Contains('32bit')) {
$32bit_count = $current.manifest.architecture.'32bit'.hash.Count
$max = $64bit_count + $32bit_count - 1 # Edge case if manifest contains 64bit and 32bit.
$current.manifest.architecture.'32bit'.hash = $actuals[($64bit_count)..$max]
$current.manifest.architecture.'32bit'.hash = $actuals[($64bit_count)..($64bit_count + $32bit_count - 1)]
}
if ($platforms.Contains('arm64')) {
$arm64_count = $current.manifest.architecture.'arm64'.hash.Count
$current.manifest.architecture.'arm64'.hash = $actuals[($64bit_count + $32bit_count)..($64bit_count + $32bit_count + $arm64_count - 1)]
}
}

Write-Host "Writing updated $($current.app) manifest" -ForegroundColor DarkGreen

$current.manifest = $current.manifest | ConvertToPrettyJson
$path = Resolve-Path "$Dir\$($current.app).json"
$path = Convert-Path $current.file
[System.IO.File]::WriteAllLines($path, $current.manifest)
}
}
18 changes: 13 additions & 5 deletions bin/checkurls.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ param(
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\install.ps1"

$Dir = Resolve-Path $Dir
$Dir = Convert-Path $Dir
$Queue = @()

Get-ChildItem $Dir "$App.json" | ForEach-Object {
$manifest = parse_json "$Dir\$($_.Name)"
$Queue += , @($_.Name, $manifest)
Get-ChildItem $Dir -Filter "$App.json" -Recurse | ForEach-Object {
$manifest = parse_json $_.FullName
$Queue += , @($_.BaseName, $manifest)
}

Write-Host '[' -NoNewLine
Expand All @@ -62,6 +62,13 @@ function test_dl([String] $url, $cookies) {
$wreq.Headers.Add('Cookie', (cookie_header $cookies))
}
}

get_config PRIVATE_HOSTS | Where-Object { $_ -ne $null -and $url -match $_.match } | ForEach-Object {
(ConvertFrom-StringData -StringData $_.Headers).GetEnumerator() | ForEach-Object {
$wreq.Headers[$_.Key] = $_.Value
}
}

$wres = $null
try {
$wres = $wreq.GetResponse()
Expand Down Expand Up @@ -91,6 +98,7 @@ foreach ($man in $Queue) {
} else {
script:url $manifest '64bit' | ForEach-Object { $urls += $_ }
script:url $manifest '32bit' | ForEach-Object { $urls += $_ }
script:url $manifest 'arm64' | ForEach-Object { $urls += $_ }
}

$urls | ForEach-Object {
Expand Down Expand Up @@ -125,7 +133,7 @@ foreach ($man in $Queue) {
Write-Host $failed -NoNewLine -ForegroundColor Red
}
Write-Host '] ' -NoNewLine
Write-Host (strip_ext $name)
Write-Host $name

$errors | ForEach-Object {
Write-Host " > $_" -ForegroundColor DarkRed
Expand Down
80 changes: 62 additions & 18 deletions bin/checkver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ param(

if ($App -ne '*' -and (Test-Path $App -PathType Leaf)) {
$Dir = Split-Path $App
$files = Get-ChildItem $Dir (Split-Path $App -Leaf)
$files = Get-ChildItem $Dir -Filter (Split-Path $App -Leaf)
} elseif ($Dir) {
$Dir = Resolve-Path $Dir
$files = Get-ChildItem $Dir "$App.json"
$Dir = Convert-Path $Dir
$files = Get-ChildItem $Dir -Filter "$App.json" -Recurse
} else {
throw "'-Dir' parameter required if '-App' is not a filepath!"
}
Expand All @@ -97,9 +97,10 @@ if ($App -eq '*' -and $Version -ne '') {
$Queue = @()
$json = ''
$files | ForEach-Object {
$json = parse_json "$Dir\$($_.Name)"
$file = $_.FullName
$json = parse_json $file
if ($json.checkver) {
$Queue += , @($_.Name, $json)
$Queue += , @($_.BaseName, $json, $file)
}
}

Expand All @@ -109,7 +110,7 @@ Get-EventSubscriber | Unregister-Event

# start all downloads
$Queue | ForEach-Object {
$name, $json = $_
$name, $json, $file = $_

$substitutions = Get-VersionSubstitution $json.version # 'autoupdate.ps1'

Expand All @@ -121,18 +122,32 @@ $Queue | ForEach-Object {
}
Register-ObjectEvent $wc downloadDataCompleted -ErrorAction Stop | Out-Null

$githubRegex = '\/releases\/tag\/(?:v|V)?([\d.]+)'

$url = $json.homepage
# Not Specified
if ($json.checkver.url) {
$url = $json.checkver.url
} else {
$url = $json.homepage
}

if ($json.checkver.re) {
$regex = $json.checkver.re
} elseif ($json.checkver.regex) {
$regex = $json.checkver.regex
} else {
$regex = ''
}
$regex = ''

$jsonpath = ''
$xpath = ''
$replace = ''
$useGithubAPI = $false

# GitHub
if ($regex) {
$githubRegex = $regex
} else {
$githubRegex = '/releases/tag/(?:v|V)?([\d.]+)'
}
if ($json.checkver -eq 'github') {
if (!$json.homepage.StartsWith('https://github.com/')) {
error "$name checkver expects the homepage to be a github repository"
Expand All @@ -148,11 +163,38 @@ $Queue | ForEach-Object {
if ($json.checkver.PSObject.Properties.Count -eq 1) { $useGithubAPI = $true }
}

if ($json.checkver.re) {
$regex = $json.checkver.re
# SourceForge
if ($regex) {
$sourceforgeRegex = $regex
} else {
$sourceforgeRegex = '(?!\.)([\d.]+)(?<=\d)'
}
if ($json.checkver.regex) {
$regex = $json.checkver.regex
if ($json.checkver -eq 'sourceforge') {
if ($json.homepage -match '//(sourceforge|sf)\.net/projects/(?<project>[^/]+)(/files/(?<path>[^/]+))?|//(?<project>[^.]+)\.(sourceforge\.(net|io)|sf\.net)') {
$project = $Matches['project']
$path = $Matches['path']
} else {
$project = strip_ext $name
}
$url = "https://sourceforge.net/projects/$project/rss"
if ($path) {
$url = $url + '?path=/' + $path.TrimStart('/')
}
$regex = "CDATA\[/$path/.*?$sourceforgeRegex.*?\]".Replace('//', '/')
}
if ($json.checkver.sourceforge) {
if ($json.checkver.sourceforge -is [System.String] -and $json.checkver.sourceforge -match '(?<project>[\w-]*)(/(?<path>.*))?') {
$project = $Matches['project']
$path = $Matches['path']
} else {
$project = $json.checkver.sourceforge.project
$path = $json.checkver.sourceforge.path
}
$url = "https://sourceforge.net/projects/$project/rss"
if ($path) {
$url = $url + '?path=/' + $path.TrimStart('/')
}
$regex = "CDATA\[/$path/.*?$sourceforgeRegex.*?\]".Replace('//', '/')
}

if ($json.checkver.jp) {
Expand All @@ -165,7 +207,7 @@ $Queue | ForEach-Object {
$xpath = $json.checkver.xpath
}

if ($json.checkver.replace -and $json.checkver.replace.GetType() -eq [System.String]) {
if ($json.checkver.replace -is [System.String]) { # If `checkver` is [System.String], it has a method called `Replace`
$replace = $json.checkver.replace
}

Expand All @@ -185,7 +227,8 @@ $Queue | ForEach-Object {
$url = substitute $url $substitutions

$state = New-Object psobject @{
app = (strip_ext $name);
app = $name;
file = $file;
url = $url;
regex = $regex;
json = $json;
Expand Down Expand Up @@ -213,6 +256,7 @@ while ($in_progress -gt 0) {

$state = $ev.SourceEventArgs.UserState
$app = $state.app
$file = $state.file
$json = $state.json
$url = $state.url
$regexp = $state.regex
Expand Down Expand Up @@ -319,7 +363,7 @@ while ($in_progress -gt 0) {
# Skip actual only if versions are same and there is no -f
if (($ver -eq $expected_ver) -and !$ForceUpdate -and $SkipUpdated) { continue }

Write-Host "$App`: " -NoNewline
Write-Host "$app`: " -NoNewline

# version hasn't changed (step over if forced update)
if ($ver -eq $expected_ver -and !$ForceUpdate) {
Expand All @@ -345,7 +389,7 @@ while ($in_progress -gt 0) {
Write-Host 'Forcing autoupdate!' -ForegroundColor DarkMagenta
}
try {
Invoke-AutoUpdate $App $Dir $json $ver $matchesHashtable # 'autoupdate.ps1'
Invoke-AutoUpdate $app $file $json $ver $matchesHashtable # 'autoupdate.ps1'
} catch {
if ($ThrowError) {
throw $_
Expand Down
8 changes: 4 additions & 4 deletions bin/describe.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ param(
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\description.ps1"

$Dir = Resolve-Path $Dir
$Dir = Convert-Path $Dir
$Queue = @()

Get-ChildItem $Dir "$App.json" | ForEach-Object {
$manifest = parse_json "$Dir\$($_.Name)"
$Queue += , @(($_.Name -replace '\.json$', ''), $manifest)
Get-ChildItem $Dir -Filter "$App.json" -Recurse | ForEach-Object {
$manifest = parse_json $_.FullName
$Queue += , @($_.BaseName, $manifest)
}

$Queue | ForEach-Object {
Expand Down
11 changes: 5 additions & 6 deletions bin/formatjson.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ param(
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\json.ps1"

$Dir = Resolve-Path $Dir

Get-ChildItem $Dir "$App.json" | ForEach-Object {
if ($PSVersionTable.PSVersion.Major -gt 5) { $_ = $_.Name } # Fix for pwsh
$Dir = Convert-Path $Dir

Get-ChildItem $Dir -Filter "$App.json" -Recurse | ForEach-Object {
$file = $_.FullName
# beautify
$json = parse_json "$Dir\$_" | ConvertToPrettyJson
$json = parse_json $file | ConvertToPrettyJson

# convert to 4 spaces
$json = $json -replace "`t", ' '
[System.IO.File]::WriteAllLines("$Dir\$_", $json)
[System.IO.File]::WriteAllLines($file, $json)
}
Loading