mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-11 00:39:03 +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": "4f34765d100d517dc137a96aabc37ab5cb95ea13",
|
|
"version-string": "5.15.2",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "f8ee9769027623f431202ff66a23a044dd3e75ba",
|
|
"version-string": "5.15.2",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "e2bf8d45dc95302a10a9a1b07e58907ba86a2e7e",
|
|
"version-string": "5.15.1",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "2cdd2ce85e66b1d3cf7f7798001fb76d6913e9c9",
|
|
"version-string": "5.15.0",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "66458d3b3efc1f979dfd3ffc7a6113ba9ec042fe",
|
|
"version-string": "5.15.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6353e7435dea1b3d6183d84e596792064687833c",
|
|
"version-string": "5.12.8",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3f9d27076e32191250206f7324c53437387771f6",
|
|
"version-string": "5.12.7",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9a69b63d04a0ebf7c04187add5838fb923bd0cb7",
|
|
"version-string": "5.12.5-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a46a48768b5ad9ea7a83115e3fa17cd30ca3e36b",
|
|
"version-string": "5.12.5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2a15360f495fa8ea1a1486b33c362ba8bd869b8b",
|
|
"version-string": "5.12.4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0367510dd4c8b49cbd3bf91a2ff5abbb90ac5b93",
|
|
"version-string": "5.12.3-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "dbbd7ec94d06153dd9076d2e6f45cfb991ef6069",
|
|
"version-string": "5.12.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a715cf6d2eb92ed537ef65ed2e97867a587d7600",
|
|
"version-string": "5.12.0",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|