mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-03 15:39: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 ```
45 lines
1.1 KiB
JSON
45 lines
1.1 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "b8fcc3b90edf020392d7fb1375c252b932a5e2be",
|
|
"version-string": "0.32.0",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "287e0a8a6edf82e89f66b9163dc3c9ba8dc46b3f",
|
|
"version-string": "0.32.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "fe169b1ce39bcfeac6979f810d0531dfe2b637ec",
|
|
"version-string": "0.30.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "76dd693c85a37b8c1dfd2e34757ec1dd1072b706",
|
|
"version-string": "0.28.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d45db1afae45cfe88d88c939aa7ee21db108c7e4",
|
|
"version-string": "0.24.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9e2652873e6426cd6c95b1b64c0a89a5203a8616",
|
|
"version-string": "0.24.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ee1a9aab6f770b0292acd2f445eb96ee686d4553",
|
|
"version-string": "0.24.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0051718b92c53caca167cf177c58757168744fca",
|
|
"version-string": "0.18.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|