mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-31 05:03:22 +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 ```
55 lines
1.3 KiB
JSON
55 lines
1.3 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "fcebb3e918a41e08cc320cede3d15872c53ad204",
|
|
"version-string": "2.0.1",
|
|
"port-version": 9
|
|
},
|
|
{
|
|
"git-tree": "c315356fbaaafea6bbcc98aa1faa32355c5b4d9b",
|
|
"version-string": "2.0.1-8",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ab289966dcf6d837c5b8274e8d49095c5cc9186a",
|
|
"version-string": "2.0.1-7",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "be10b502afcaa42b2e82ea7c5c1a21a3e889bf9b",
|
|
"version-string": "2.0.1-6",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "16ad4ad807ad672818ceda635b8ced44cdf59e30",
|
|
"version-string": "2.0.1-5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b9ca8129b5a86757c8a813f652a01e61a79f2ded",
|
|
"version-string": "2.0.1-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "207d5cbf9edb9c31dd4aff8539e8aece515db4f3",
|
|
"version-string": "2.0.1-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4a7e5537e8b19fef689e488ab5ca861260a2ff8a",
|
|
"version-string": "2.0.1-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2605c7ba1ef533eb740ec996522daf9a3791bcdc",
|
|
"version-string": "2.0.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c8cfd2be3ec7f13f029ac8bfa29c87c2aa45ef71",
|
|
"version-string": "2.0.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|