vcpkg/versions/f-/fastrtps.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

35 lines
821 B
JSON

{
"versions": [
{
"git-tree": "d48d4af7b7082b1a162b136643f6d51dd5b8beba",
"version-string": "2.0.1",
"port-version": 1
},
{
"git-tree": "e51ca9a6f1e9a2e3d838927fbf255a827e7d2014",
"version-string": "2.0.1",
"port-version": 0
},
{
"git-tree": "aa40bbcf396f97933016f3c195bfc0d4e212c134",
"version-string": "1.5.0-3",
"port-version": 0
},
{
"git-tree": "17766b7858439aa162dfe0a585aee24d5faf311c",
"version-string": "1.5.0-2",
"port-version": 0
},
{
"git-tree": "53262c94641be5ba67758fffa2ae03bdcc9ee830",
"version-string": "1.5.0-1",
"port-version": 0
},
{
"git-tree": "f2a0d7295ff083e9ee163d7be29aa7c88b3f5fd7",
"version-string": "1.5.0",
"port-version": 0
}
]
}