vcpkg/versions/l-/liblemon.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

45 lines
1.1 KiB
JSON

{
"versions": [
{
"git-tree": "fbcfa0caff95b07142e28cd453690c26d62bc025",
"version-string": "2019-06-13",
"port-version": 2
},
{
"git-tree": "7539b1a880c2328db9aacdc9c8f5475abfbd1af2",
"version-string": "2019-06-13-1",
"port-version": 0
},
{
"git-tree": "3f25cabf02c7a7257f79ec3578eb5a7f797419c8",
"version-string": "2019-06-13",
"port-version": 0
},
{
"git-tree": "b40bf74431a9cfa800bed32e3c749f909de79d56",
"version-string": "1.3.1-5",
"port-version": 0
},
{
"git-tree": "1af30639293df04ca201764c213c63e0249c722f",
"version-string": "1.3.1-4",
"port-version": 0
},
{
"git-tree": "5963376d21c03c526520f226327c151886f84725",
"version-string": "1.3.1-3",
"port-version": 0
},
{
"git-tree": "5dbb03bed23825b0426765fe6056f2ee5e1b88b9",
"version-string": "1.3.1-2",
"port-version": 0
},
{
"git-tree": "8fe17928a54d671313210fc5d87f10346f9722fe",
"version-string": "1.3.1-1",
"port-version": 0
}
]
}