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

60 lines
1.5 KiB
JSON

{
"versions": [
{
"git-tree": "882ea9cab4a482db6b23eae2592a5f93f4f27035",
"version-string": "0.6.1",
"port-version": 1
},
{
"git-tree": "52a59e9f37b1e0db67ab735c29199f7eaf6ff1b8",
"version-string": "0.6.1",
"port-version": 0
},
{
"git-tree": "2ea3393213f782ec570e7964de5cb48726d88400",
"version-string": "0.6.0-1",
"port-version": 0
},
{
"git-tree": "eb5b239c1912dfed5e9b87ac23a2085973b071d7",
"version-string": "0.6.0",
"port-version": 0
},
{
"git-tree": "2d9043ecd2095d989dd082a48beaddf64f984f21",
"version-string": "0.5.0-7",
"port-version": 0
},
{
"git-tree": "389f3adf2e0b7acb1c511dc53673923d140d4e7d",
"version-string": "0.5.0-6",
"port-version": 0
},
{
"git-tree": "65b329630785aafa07fc75bcb87341014b66d61e",
"version-string": "0.5.0-5",
"port-version": 0
},
{
"git-tree": "8e4f163e6f265302485cda587b99a90391abf64a",
"version-string": "0.5.0-4",
"port-version": 0
},
{
"git-tree": "b165475332793a49c0a2671bdec393ac979b8c35",
"version-string": "0.5.0-3",
"port-version": 0
},
{
"git-tree": "a431a8e141b13406c850a81731e86a0faf5617d8",
"version-string": "0.5.0-2",
"port-version": 0
},
{
"git-tree": "af91670ae8791c355625eebec28ee88634abf33f",
"version-string": "0.5.0-1",
"port-version": 0
}
]
}