vcpkg/versions/t-/tidy-html5.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": "6b446932540002cb1b664d7f5286fdb6c0f7af28",
"version-string": "5.7.28",
"port-version": 3
},
{
"git-tree": "b050c4d466a093f1322998c0c2c356698954bc40",
"version-string": "5.7.28-2",
"port-version": 0
},
{
"git-tree": "3bf8e46176d46eb4f2257eae9125e0f3b7d4e14d",
"version-string": "5.7.28-1",
"port-version": 0
},
{
"git-tree": "2fd4ec0db75ada0702deee02df23d08760decd1e",
"version-string": "5.7.28",
"port-version": 0
},
{
"git-tree": "d044424f994b97e93466cc4d0f8e5de145452cd9",
"version-string": "5.6.0-1",
"port-version": 0
},
{
"git-tree": "81b0263817c84a34e56920ba932f10ad23c07427",
"version-string": "5.6.0",
"port-version": 0
},
{
"git-tree": "954df61d2f7aac784611519277c395fc9e26007f",
"version-string": "5.4.0-2",
"port-version": 0
},
{
"git-tree": "9536522198412a2c1a5dae3522e4ec50add7b9c4",
"version-string": "5.4.0-1",
"port-version": 0
},
{
"git-tree": "f67593b0a7ff5dba6d5aa76743d9ac64f6a02d09",
"version-string": "5.4.0",
"port-version": 0
}
]
}