vcpkg/versions/c-/cpp-redis.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

55 lines
1.3 KiB
JSON

{
"versions": [
{
"git-tree": "f412f0e14f585bccfec1add71fd23ad9ea8f1f9f",
"version-string": "4.3.1",
"port-version": 3
},
{
"git-tree": "6e73617915b055400da154a55b8c3682a0ace51c",
"version-string": "4.3.1-2",
"port-version": 0
},
{
"git-tree": "69f9fe97f257cb03b1d3746e4ac9a5a020044b47",
"version-string": "4.3.1-1",
"port-version": 0
},
{
"git-tree": "1aecbff26478a3de6098ab3e954253cb905c442d",
"version-string": "4.3.1",
"port-version": 0
},
{
"git-tree": "4a6ab5d4e38191cfd6a56d1ec63a65996255d8e9",
"version-string": "4.3.0",
"port-version": 0
},
{
"git-tree": "55b68b47bc2b3844eeaa690339d1c497ec8662a4",
"version-string": "3.5.2-2",
"port-version": 0
},
{
"git-tree": "c72ae6224b21ed61122f73d8af15cb8f9346e32d",
"version-string": "3.5.2-1",
"port-version": 0
},
{
"git-tree": "692097332992307fa26f25c9d6ea9fdfbbcd120f",
"version-string": "3.5.2",
"port-version": 0
},
{
"git-tree": "d8c526ede1b8b2f7600e61c540f134b99ed41feb",
"version-string": "3.5.1-1",
"port-version": 0
},
{
"git-tree": "e299dadaf41b8f460109f2e8206b4c5cc4a1a2fa",
"version-string": "3.5.1",
"port-version": 0
}
]
}