vcpkg/versions/w-/wavpack.json
Billy O'Neal b295670e4b
Bulk convert control files. (#19986)
```
function Convert-Control {
    Param($full)
    .\vcpkg.exe format-manifest $full
    $root = $full.Substring(0, $full.Length - 7) # CONTROL
    $new = $root + 'vcpkg.json'
    $content = Get-Content -Raw $new
    $asJson = ConvertFrom-Json $content -AsHashtable -Depth 100
    $oldVersion = $asJson['port-version']
    if ($null -eq $oldVersion) {
        $oldVersionFull = $asJson['version-string']
        Write-Host "Got version $oldVersionFull"
        $match = [System.Text.RegularExpressions.Regex]::Match($oldVersionFull, '^(.+)-(\d+)$')
        if ($match.Success -and -not [System.Text.RegularExpressions.Regex]::IsMatch($oldVersionFull, '^\d\d\d\d-\d\d-\d\d$')) {
            $newFullVersion = [string]$match.Groups[1].Value
            $oldVersion = [int]$match.Groups[2].Value
            Write-Host "newFullVersion $newFullVersion oldVersion $oldVersion"
            $newVersion = $oldVersion + 1
            $asJson['version-string'] = $newFullVersion
            Write-Host "Previous version for $full extracted from version field -- setting version-string $newFullVersion and port-version $newVersion"
        } else {
            Write-Host "No previous version for $full -- setting 1"
            $newVersion = 1
        }
    } else {
        $newVersion = [int]$oldVersion + 1
        Write-Host "New version for $full : $newVersion"
    }

    $asJson['port-version'] = $newVersion

    $content = ConvertTo-Json $asJson -Depth 100
    Set-Content -Path $new -Value $content
    .\vcpkg.exe format-manifest $new
}

Get-ChildItem ports\CONTROL -Recurse | Foreach-Object {
    Convert-Control $_.FullName
}

git commit -am "this message"
.\vcpkg.exe x-add-version -all
git commit -a --amend
```
2021-09-09 01:24:04 -07:00

55 lines
1.3 KiB
JSON

{
"versions": [
{
"git-tree": "e5a933ff5c3c9d43e3bf43beb816b458be6025d3",
"version-string": "5.3.0",
"port-version": 2
},
{
"git-tree": "73e8b55fed24b05b9c0b9f84d1bc85196c241ca3",
"version-string": "5.3.0",
"port-version": 1
},
{
"git-tree": "ab00fac3cf38ba1104e6365183fe6f7bef09f46d",
"version-string": "5.3.0",
"port-version": 0
},
{
"git-tree": "bd620d16a01ecde17323db2154a80ebb853e8846",
"version-string": "5.2.0",
"port-version": 3
},
{
"git-tree": "826907414aaece4ac4d8805257854606c8b06a5f",
"version-string": "5.2.0",
"port-version": 1
},
{
"git-tree": "3dbc3902cdc5287d7e82e6ec3edcc9debe0674e9",
"version-string": "5.2.0",
"port-version": 0
},
{
"git-tree": "620b352213995ac2178ccf37a719d8bb967af15c",
"version-string": "5.1.0-3",
"port-version": 0
},
{
"git-tree": "8e4f15ac424d642972445dd66d0eeb7133d24423",
"version-string": "5.1.0-2",
"port-version": 0
},
{
"git-tree": "bdbedb1d1b7a724f3d70ccb1b953fefc5ce91ab3",
"version-string": "5.1.0-00d9a4a-1",
"port-version": 0
},
{
"git-tree": "fc15c5e9549323ad4b173b21fa1e0dd119dce421",
"version-string": "5.1.0-00d9a4a",
"port-version": 0
}
]
}