vcpkg/versions/t-/telnetpp.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

45 lines
1.1 KiB
JSON

{
"versions": [
{
"git-tree": "e90806a190428cbf53773ea93d5bdacb7f92f7c0",
"version-string": "2.1.2",
"port-version": 1
},
{
"git-tree": "904e2801ba11dae44b62c252e4b6193b50e63fd2",
"version-string": "2.1.2",
"port-version": 0
},
{
"git-tree": "d7db43baec43a10c0b48d9d86e1331d4da573f2d",
"version-string": "2.0-4",
"port-version": 0
},
{
"git-tree": "a326437fbff54619f8e88842303a9fe65f3d0a7a",
"version-string": "2.0-3",
"port-version": 0
},
{
"git-tree": "20acece0d3d048018b9e5b4e01c98b6a0026fd36",
"version-string": "2.0-2",
"port-version": 0
},
{
"git-tree": "c66573d58de425381ca8545a8cff430038685ae0",
"version-string": "2.0",
"port-version": 0
},
{
"git-tree": "70fa20ea4cf3ea35101b93f70b9722a207bda47f",
"version-string": "1.2.4-1",
"port-version": 0
},
{
"git-tree": "362984ae95ea46793ce363484c0a1368512661e4",
"version-string": "1.2.4",
"port-version": 0
}
]
}