mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-29 20:23: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 ```
70 lines
1.7 KiB
JSON
70 lines
1.7 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "5068586428e64792c526ff7192b26ca96f27a673",
|
|
"version-string": "1.80.0",
|
|
"port-version": 3
|
|
},
|
|
{
|
|
"git-tree": "620a94070633a9f786e0052d848c16632bd307b5",
|
|
"version-string": "1.80.0",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "27c2329af94e2199b49c1d01da4136fe0891105f",
|
|
"version-string": "1.80.0",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "9ed8135c6708327c0e5515bf2b3c175f113d3802",
|
|
"version-string": "1.80.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0ddf0c5660376a7b0ae1c641e71ed8c348f4996f",
|
|
"version-string": "1.78.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "64bbacef132cc5a87b5a490cff4d27db3455311b",
|
|
"version-string": "1.78.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "78a927b8258976486692ac5badb19de106cab81c",
|
|
"version-string": "1.76.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6030d672c4f2f06353227902a3fa0fc1129f0e6e",
|
|
"version-string": "1.76.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8157e86a51d1b004e1db007e30ae865241c75ff5",
|
|
"version-string": "1.74.4-5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1ffd3aac6861f39d94248c3f40736d74820f8d28",
|
|
"version-string": "1.74.4-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6be9502011cb80993014849fdb2ebf2b59d0d8b3",
|
|
"version-string": "1.74.4-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "166acbf4ed05ce08247d3194b30684a4c5d27937",
|
|
"version-string": "1.74.4-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "67be31d07999377c75fda2b1208c749261294667",
|
|
"version-string": "1.74.4",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|