vcpkg/versions/g-/google-cloud-cpp-common.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": "3a208fcc136917aefe4e696aed7ce013d8ba9aa4",
"version-string": "alias",
"port-version": 1
},
{
"git-tree": "6e60e7b9b08e821b11e3e1512bbd1b3caffbc21b",
"version-string": "alias",
"port-version": 0
},
{
"git-tree": "a9681d3e137a323b07e3c7540a53eb120d1a4dd6",
"version-string": "0.25.0",
"port-version": 0
},
{
"git-tree": "e694b18a9c319a548e711726ecd23371d20674a4",
"version-string": "0.21.0",
"port-version": 0
},
{
"git-tree": "56624554a6224d8dde6b080055042c7db739884f",
"version-string": "0.20.0",
"port-version": 0
},
{
"git-tree": "4f3466fd53b4d726a5339784f2c7af973e2c4231",
"version-string": "0.19.0",
"port-version": 0
},
{
"git-tree": "b7140fb29c018fcb3970ae4bcae81e74c90182d8",
"version-string": "0.18.0",
"port-version": 0
},
{
"git-tree": "b75cd45782941bceed2f41b9eba995a39ed3a86a",
"version-string": "0.16.0-1",
"port-version": 0
},
{
"git-tree": "1499ccc25e9d9d8003863af89b484aee54839ff8",
"version-string": "0.16.0",
"port-version": 0
},
{
"git-tree": "0fb815d0f006996c31975f02a1244946d7ebd2c6",
"version-string": "0.15.0",
"port-version": 0
}
]
}