mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 12:29:32 +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 ```
50 lines
1.2 KiB
JSON
50 lines
1.2 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "9192001e60ba1f9d34e8f45ecde1139c5d40d474",
|
|
"version-string": "0.12",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "3c2a8c76974f548268451580c5e5599c7d435dc6",
|
|
"version-string": "0.12",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6babcac9da97faeb2c14466f0cf1b8e61d2f90f1",
|
|
"version-string": "0.11-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "364f3b3b74ca6bf8084cd6735cbb0577dabfe622",
|
|
"version-string": "0.11-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "33ee3f01ce0517204edd08658bd7b0d4280c9212",
|
|
"version-string": "0.11-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "375d6c02bd5d27e50e3414a1a3babb7e28252c65",
|
|
"version-string": "0.9-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "fa3d58a5fb67ec576bf6539ad58c18f333ae4624",
|
|
"version-string": "0.9-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d5cb4cf49e0e86575af4679f7573290496667f0c",
|
|
"version-string": "0.9",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "666fb9ac0e1713dc5852501af1096752bfcc60c6",
|
|
"version-string": "0.8",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|