mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-29 04:09:01 +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": "6f1a45086676ff21d75b117b36ae0a3b75e88feb",
|
|
"version-string": "1.6.2",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "621952db117431abe06ab8ec62f509ab812d239d",
|
|
"version-string": "1.6.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e61d04c623257948c14a329a193005d310f62cbe",
|
|
"version-string": "1.5.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b4727e0e08634c4abb16766c4bf43e02aea53549",
|
|
"version-string": "1.5.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e9b74b1491fe3e58ff8a903f2c738852b77bd829",
|
|
"version-string": "1.5.0-51648bb",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "aadf97900b05b95f724ebe0c03d234cb2e66f201",
|
|
"version-string": "1.5.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "81ead1689968284e1ed9f375b30f74d1481d96ae",
|
|
"version-string": "1.4.9-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e0941a55d608f8f0a138224d1ae1ac1f090caa55",
|
|
"version-string": "1.4.9",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ad3b1a16b5a01ff6a6ce88b78bae98a394d84ef6",
|
|
"version-string": "1.4.8",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|