vcpkg/versions/o-/opencl.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": "f0d58793b575b614e5832f803d5e679b64e991a9",
"version-string": "2.2",
"port-version": 8
},
{
"git-tree": "9f93abeb8cc37eb7d67dc0c5f526ec264735de56",
"version-string": "2.2",
"port-version": 7
},
{
"git-tree": "c886ba756e6871aa46eeca3d34cb9ca852fcb3e9",
"version-string": "2.2",
"port-version": 6
},
{
"git-tree": "0e60dc7d1ed49b1093ac144edc526a66b8f2e9f1",
"version-string": "2.2",
"port-version": 5
},
{
"git-tree": "b2b7c1026dd49d8540310e1e9a4c02f9c01319c2",
"version-string": "2.2",
"port-version": 4
},
{
"git-tree": "9860a576380ef6c492b0975715eed6e4eb619c37",
"version-string": "2.2",
"port-version": 3
},
{
"git-tree": "d27cc2902406fcce6098369f2ec132601f5050c7",
"version-string": "2.2-2-1",
"port-version": 0
},
{
"git-tree": "ada5d8051a1040716f60e762aa6bd53184d1d3b7",
"version-string": "2.2-2",
"port-version": 0
},
{
"git-tree": "29e052403252b1ac00345ecf3b935bca1cabd2a3",
"version-string": "2.2 (2018.08.31)",
"port-version": 0
},
{
"git-tree": "d53f122d6440dd37f1816452f725cfa2b27ab13a",
"version-string": "2.2 (2017.07.18)-1",
"port-version": 0
},
{
"git-tree": "6bdf7f756cb460776fb5277d139df4250e827373",
"version-string": "2.2 (2017.07.18)",
"port-version": 0
}
]
}