mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 15:31:48 +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 ```
50 lines
1.2 KiB
JSON
50 lines
1.2 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "9e4f395b731d46fde09836e4ff9a23ace6c74a6a",
|
|
"version-string": "0.8",
|
|
"port-version": 4
|
|
},
|
|
{
|
|
"git-tree": "6d74e7de2d80d5f3675b381e39c5fedd34493531",
|
|
"version-string": "0.8",
|
|
"port-version": 3
|
|
},
|
|
{
|
|
"git-tree": "881d1dad1876ac1ac89588a95070e7dcc21cff9c",
|
|
"version-string": "0.8-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d6f6a07f80be40dcc23b7f887728bf89acbfa293",
|
|
"version-string": "0.8",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "98ef85c66ffddd9807fd365c050a3fd998732ff1",
|
|
"version-string": "0.7-d15154a-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "20c5d5f1ca4c02020d4143c58baf183fd524d22e",
|
|
"version-string": "0.7-d15154a-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8922734aad943c5ca6551fba2ba55eb08dd530c4",
|
|
"version-string": "0.7-d15154a-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c24f13e44f8ab6f0188fe80d263bfd2b5fa3c83f",
|
|
"version-string": "0.7-d15154a-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ab972b58b4222c8efedd2caa93b84c15e445de6b",
|
|
"version-string": "0.7-d15154a",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|