mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-26 00:39:00 +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 ```
65 lines
1.6 KiB
JSON
65 lines
1.6 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "43b8008115ab934b4cf1b36c38bb02ed845712bd",
|
|
"version-string": "10.1",
|
|
"port-version": 8
|
|
},
|
|
{
|
|
"git-tree": "f81f6321111048d45f0c5e41644ee26a0ccb9c13",
|
|
"version-string": "10.1",
|
|
"port-version": 7
|
|
},
|
|
{
|
|
"git-tree": "cd48424964a6d19d032e14e84dbd41c5cdcb05ef",
|
|
"version-string": "10.1",
|
|
"port-version": 6
|
|
},
|
|
{
|
|
"git-tree": "0022275f9aa9e2d70f6a35d7e28fb27ab21fd13e",
|
|
"version-string": "10.1",
|
|
"port-version": 5
|
|
},
|
|
{
|
|
"git-tree": "b692639f7b4b82f90b80e33dc3d6da2983975ab5",
|
|
"version-string": "10.1",
|
|
"port-version": 4
|
|
},
|
|
{
|
|
"git-tree": "ca5aa9e76b7b91b7104ad108b448dbf1719b5530",
|
|
"version-string": "10.1",
|
|
"port-version": 3
|
|
},
|
|
{
|
|
"git-tree": "e21c4698f343b201e52e8fc6163a4573bf94b274",
|
|
"version-string": "10.1",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "896402a9ab10ead504697b7fd62992ce379f1f13",
|
|
"version-string": "10.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4b8ccbadfeb5ec1148135d0620c203f6ceeaf813",
|
|
"version-string": "10.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "aac6a595a656340084cd13ee7aa8e39308e60cb9",
|
|
"version-string": "9.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "18842eaf8f339b66d8bf7bc1e1cb52f7d0674db0",
|
|
"version-string": "8.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "aa51016a592261707294e823934d0464b988d3ac",
|
|
"version-string": "8.0",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|