vcpkg/versions/m-/msgpack.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

50 lines
1.2 KiB
JSON

{
"versions": [
{
"git-tree": "ed079e3006a28fcef3dc95c108e03d20027de40c",
"version-string": "3.3.0",
"port-version": 1
},
{
"git-tree": "61d9adf5fb7555558588762d38e34544c6a38e25",
"version-string": "3.3.0",
"port-version": 0
},
{
"git-tree": "6fcf40eb0910b55deab3d0d658a20ca14887f45c",
"version-string": "3.2.0",
"port-version": 2
},
{
"git-tree": "2f4408c870bd4282eccda8dad23e71e0fef4a157",
"version-string": "3.2.0-1",
"port-version": 0
},
{
"git-tree": "65ea7098427ad52422df996fca814abf693d7e7f",
"version-string": "3.2.0",
"port-version": 0
},
{
"git-tree": "d4af0641ad69926a91d7a6814dd28a69edd8df26",
"version-string": "3.1.1",
"port-version": 0
},
{
"git-tree": "707941e4e28397a9436b66ca26762d445401898f",
"version-string": "2.1.5-1",
"port-version": 0
},
{
"git-tree": "3b3e664ae5942b8b824dab13ca32c0c16e83d3d8",
"version-string": "2.1.5",
"port-version": 0
},
{
"git-tree": "8cc54cfaa7f70798f0d63cda39d3a30ba31a57c1",
"version-string": "2.1.1",
"port-version": 0
}
]
}