Skip to content

Commit

Permalink
[boost generate-ports] Derive port-version from master baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt committed May 19, 2024
1 parent c430e62 commit f2a07bf
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions scripts/boost/generate-ports.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,21 @@ if ($null -eq $vcpkg) {
# Beta builds contains a text in the version string
$semverVersion = ($version -replace "(\d+(\.\d+){1,3}).*", "`$1")

# Clear this array when moving to a new boost version
$defaultPortVersion = 1
$portVersions = @{
}
"Downloading baseline.json from master..."
Invoke-WebRequest -Uri "https://github.com/microsoft/vcpkg/raw/master/versions/baseline.json" -OutFile "$scriptsDir/baseline.json"

$baseline = Get-Content -LiteralPath "$scriptsDir/baseline.json" -Raw `
| ConvertFrom-Json `
| Select-Object -ExpandProperty 'default'

function Get-PortVersion {
param (
[string]$PortName
)

$nonDefault = $portVersions[$PortName]
if ($null -ne $nonDefault) {
return $nonDefault
if ($baseline.$PortName.baseline -eq $semverVersion) {
return $baseline.$PortName.'port-version' + 1
}

return $defaultPortVersion
return 0
}

$portData = @{
Expand Down

0 comments on commit f2a07bf

Please sign in to comment.