mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 08:19: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 ```
70 lines
1.7 KiB
JSON
70 lines
1.7 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "8af1cbe5e5d6b5d098b15f4e5548d4e315afb4b0",
|
|
"version-string": "3.4",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "021ea7daa5d0f6d63bfa2617811a68639e7f5964",
|
|
"version-string": "3.4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "37e244cbce12ef477bf3320125a2d5063b81612b",
|
|
"version-string": "3.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b921f9c73727bcde64c8de913b2138e07f907c6e",
|
|
"version-string": "3.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "88c18697cc50e200307fb05c21bae6bcda33c029",
|
|
"version-string": "3.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "04b3368d3a326ef3cd41217a01dbaaaefa1ee5cb",
|
|
"version-string": "3.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "33a0913f00547a5b5ca23b5293b676e5ba878bc7",
|
|
"version-string": "2.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a561b3d689bcf262d6f61dd72577811023c17bea",
|
|
"version-string": "2.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "7bc1b3624966ed9338fe2431857ff617fa3a853b",
|
|
"version-string": "2.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e3916b3b152b1f35681b12dc220bf905e470747d",
|
|
"version-string": "2.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d256807923c140edf9726259de352ec874125970",
|
|
"version-string": "1.7",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e8536fad5cda700a238dfc496a2cae46405ec1d2",
|
|
"version-string": "1.6-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "51b5047362c5d2777271a9fe43ad0d5fc5f5137a",
|
|
"version-string": "1.6",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|