mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 20:46:41 +08:00
b295670e4b
``` 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 ```
60 lines
1.5 KiB
JSON
60 lines
1.5 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "0d29f4f5d2e2d2fd70c4489149d81cc548d31cc1",
|
|
"version-string": "1.18.1",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "117ae787801719558e153574030647da9fc16cf7",
|
|
"version-string": "1.18.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0cecc386e1baf145470db8b70665961eec9e9747",
|
|
"version-string": "1.17.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "da134ec965f1cdb754429bed31f5791e7664c285",
|
|
"version-string": "1.17.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "901567081986ac0c6c0439eb3051362d3eb76712",
|
|
"version-string": "1.17.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d4d243af848ef5d98e8dcbbb4c321d93d24e5b7a",
|
|
"version-string": "1.16.3-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "31cddb54ae5c7610884c84368d7c4397c78fee76",
|
|
"version-string": "1.16.3-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b23aeb29445076d710423ebbae55bc3450fdb69c",
|
|
"version-string": "1.16.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "97e82fc8da36b2ecd4660ed9cbda3a2c2d8225fe",
|
|
"version-string": "1.13.5-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "5a5ca69dc95323c180acf87676eb9f5107c74828",
|
|
"version-string": "1.13.5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c2403773d4b9e8c8146534ba2581806fab2da116",
|
|
"version-string": "1.12.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|