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

85 lines
2.1 KiB
JSON

{
"versions": [
{
"git-tree": "a7907c76300594175b45a5fa05bacee2b91c9a65",
"version-string": "3.2.1",
"port-version": 6
},
{
"git-tree": "bfc1c37b44246e2a3c8bfead99af1d14a2103453",
"version-string": "3.2.1",
"port-version": 5
},
{
"git-tree": "e74a294251de6c8168d8c7015a497a9a0dd91185",
"version-string": "3.2.1-4",
"port-version": 0
},
{
"git-tree": "9a44b3ab8895a9a0c355280e89d8bcf1a1952f54",
"version-string": "3.2.1-2",
"port-version": 0
},
{
"git-tree": "5b1624ac930d31a4a6240da335be3be9bb94952d",
"version-string": "3.2.1-1",
"port-version": 0
},
{
"git-tree": "ffb0fc4d48a0660a27d21a7c3f360baa9be9e773",
"version-string": "3.2.1",
"port-version": 0
},
{
"git-tree": "732672fe4e52daec7d724306f61a294e572a998a",
"version-string": "3.0.0-9",
"port-version": 0
},
{
"git-tree": "9e70602bc65fada7f8c732063cd6f639e7097861",
"version-string": "3.0.0-8",
"port-version": 0
},
{
"git-tree": "1395636f1595dbdee7a8476e206285c6338fe06e",
"version-string": "3.0.0-7",
"port-version": 0
},
{
"git-tree": "9bdaf794a8402cf24f71299d8ab812cb4aa53de3",
"version-string": "3.0.0-6",
"port-version": 0
},
{
"git-tree": "d1ec2367e350126494330879c2bafecd64eb5f32",
"version-string": "3.0.0-5",
"port-version": 0
},
{
"git-tree": "5e18393e2adaf8022fd3fc6d5d9fb410e440aff3",
"version-string": "3.0.0-4",
"port-version": 0
},
{
"git-tree": "60e8b9879521d6bd5e4326e0f80af61d51900d4e",
"version-string": "3.0.0-3",
"port-version": 0
},
{
"git-tree": "f6492aad63022ab06c0a5c23af106b363c79084a",
"version-string": "3.0.0-2",
"port-version": 0
},
{
"git-tree": "890f5e592f28ef98b9e10d34f4d0d79670539987",
"version-string": "3.0.0-1",
"port-version": 0
},
{
"git-tree": "4bb24b2206a2441baa09ac2db53f87a43a6586d0",
"version-string": "3.0.0",
"port-version": 0
}
]
}