vcpkg/versions/l-/libusbmuxd.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": "a50e755ad62ff56d5012dd84e0ccd196175a807c",
"version-string": "1.2.219",
"port-version": 1
},
{
"git-tree": "51dcfc0be39078d8d8d64dd51188a0ccae761667",
"version-string": "1.2.219",
"port-version": 0
},
{
"git-tree": "08d463bfee14e9d6d1d804bf6e59c08b7c2eb478",
"version-string": "1.2.185-1",
"port-version": 0
},
{
"git-tree": "14feef0b5b263e332b431eca6abd0081d00fbb5f",
"version-string": "1.2.185",
"port-version": 0
},
{
"git-tree": "4e6aa8c67d854c6f880c5dbdad99704e5010826b",
"version-string": "1.2.137",
"port-version": 0
},
{
"git-tree": "3787b01e075ba64c494b6fdc3b4b901d3a575475",
"version-string": "1.2.77-1",
"port-version": 0
},
{
"git-tree": "741230c70d793b4970751e08f1f3c7bcf41de43c",
"version-string": "1.2.77",
"port-version": 0
},
{
"git-tree": "83666e8678900251e18a0655c785d218e7335a0c",
"version-string": "1.0.107-2",
"port-version": 0
},
{
"git-tree": "e550cb1345e74ed0e4b9123f31bd4cf0bcd7c507",
"version-string": "1.0.107-1",
"port-version": 0
}
]
}