vcpkg/versions/v-/vxl.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.4 KiB
JSON

{
"versions": [
{
"git-tree": "dd1be33b316bf4d081b89e1dd4a729ddfc09a8a6",
"version-string": "2.0.2",
"port-version": 3
},
{
"git-tree": "fefdd1e45140fa292b0f597ae2ef658731f95b18",
"version-string": "2.0.2",
"port-version": 2
},
{
"git-tree": "ee7fcf9f131d14db523eabd68494601deba24361",
"version-string": "2.0.2",
"port-version": 1
},
{
"git-tree": "a3673fb476501793910afb7f06dc644f93679228",
"version-string": "2.0.2",
"port-version": 0
},
{
"git-tree": "f0836e2cd5a5cf43dd5ea707237c74ac9b4ae557",
"version-string": "v1.18.0-4",
"port-version": 0
},
{
"git-tree": "b9c00596aced831c75a0c4f9589f305645f15182",
"version-string": "v1.18.0-3",
"port-version": 0
},
{
"git-tree": "9c69d40cd32f205a40bf91855ca095c86a545d63",
"version-string": "v1.18.0-2",
"port-version": 0
},
{
"git-tree": "1e5ac28eb237d1700182e37c98db7e8cb553b01a",
"version-string": "v1.18.0-1",
"port-version": 0
},
{
"git-tree": "c9490f087a76c77dd9e4ba23d3c8bb6ba5d1a250",
"version-string": "20180414-7a130cf-1",
"port-version": 0
},
{
"git-tree": "495a0bcaa231545503d242682e0e712dba8901d2",
"version-string": "20180414-7a130cf",
"port-version": 0
}
]
}