mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 14:29:03 +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.2 KiB
JSON
45 lines
1.2 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "f54e2dbc66d96847b2b075baa7ae3a4cc032328d",
|
|
"version-string": "1.2.0alpha1-20170719",
|
|
"port-version": 3
|
|
},
|
|
{
|
|
"git-tree": "8a881f4b426f98ea87c67e6b5afadd57ed634a95",
|
|
"version-string": "1.2.0alpha1-20170719",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "21aea39dae9f003157b38fadb9e6fc23ccb89233",
|
|
"version-string": "1.2.0alpha1-20170719-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "377a16ad9325873e7889c24417eef7c0ba52ec2b",
|
|
"version-string": "1.2.0alpha1-20170719~vcpkg1-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d4ad6da485400da97f2347693b47afadbdea7027",
|
|
"version-string": "1.2.0alpha1-20170719~vcpkg1-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e121d8289751b5ca72afad3f9e1bd98b7f66c973",
|
|
"version-string": "1.2.0alpha1-20170719~vcpkg1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "30b8d4c154cdf6a5553d03dc76a9e83dd6e94fc4",
|
|
"version-string": "1.2.0alpha1-20170719~vcpkg1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "099587b9692d8e05ceed9ba922140bbefa763753",
|
|
"version-string": "1.1.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|