mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-18 13:48:20 +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 ```
75 lines
1.8 KiB
JSON
75 lines
1.8 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "2092d648b56a683bcd8b3e72f4adc3a966956c17",
|
|
"version-string": "8.5.0",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "c8aee6279ffed7e7e1f9037c15937643c315a999",
|
|
"version-string": "8.5.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ad41b9e4eb55001f640b5aab811f288862829d70",
|
|
"version-string": "8.2.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1f72925199ecfcd7e2b929372af100e95c80bc2e",
|
|
"version-string": "8.2.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c38385f64a782e04b07d8d52270238d7c67531c0",
|
|
"version-string": "8.2.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9abae7256650f7984be9a8842e2065632fa04873",
|
|
"version-string": "8.1.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "301eaab34677f43ea45fc8a3595b95e1dba667b9",
|
|
"version-string": "8.1.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6214913a24800179f96967ff011b4971f0ba37c4",
|
|
"version-string": "8.1.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ed9ae9c16bf325ce8174bca07b5c631d67a476a4",
|
|
"version-string": "8.0.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1ba7e947a88e4974ef1cfa79fd593ac76fdec852",
|
|
"version-string": "7.0.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2092d28a83d075bd3e55502cd553bdc05bfbe5d9",
|
|
"version-string": "6.1.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9120c6cf23a2f6d11b278b84dca0293f339a4335",
|
|
"version-string": "6.1.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2ea8fd174557a9efb2964a7c725f04b599caac12",
|
|
"version-string": "5.6.5-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "48bdda8cdb96b1feeb88c61c839ea06db57c723d",
|
|
"version-string": "5.6.5",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|