mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-30 20:39:07 +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": "55d462cc4fb637891cc2d1dda24a9bd97c7d38f5",
|
|
"version-string": "2.9.4",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "ad1f223d4c2eaa1a904f08153ec3b09854c0e393",
|
|
"version-string": "2.9.4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8525a804bbb90dcf1ac4f28b176e205c0af26519",
|
|
"version-string": "2.9.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e1af42a470fee65bfbab0dad2ef6011d885b7390",
|
|
"version-string": "2.9.2-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ed7bcfe851f539b4949b9e4947f4191a50dbc2b9",
|
|
"version-string": "2.9.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8330edae768537c8a68241a33a34a8da2d2c5f4c",
|
|
"version-string": "2.9.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b69b623e0c2bb31af83b21778b7ab4e33abb46d3",
|
|
"version-string": "2.9.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "47283005d12933a6fed28bb6a9a1422f818df496",
|
|
"version-string": "2.8.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "30d289cfa6f6ac7e9a898dba5016d9c444abdf2c",
|
|
"version-string": "2.7.1-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9d99708da66254c483bbc93b1ea01849dedf8090",
|
|
"version-string": "2.7.1-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ded9b7f2ee8f087925d7a6ed61cbedddf1d055a9",
|
|
"version-string": "2.7.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "af958e429245254d86d3845fef33bfb07649ddbe",
|
|
"version-string": "2.7.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|