mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-30 20:29:02 +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 ```
40 lines
1014 B
JSON
40 lines
1014 B
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "ac754f80d0eec3321c07b9389b10ba93490ee148",
|
|
"version-string": "2020-09-14",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "15e912afd73f5656dfaae90459274f72ff3b7fee",
|
|
"version-string": "2020-09-14",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "24e3bf58a4726a390ec8c6aef7f1dd45b0d7274e",
|
|
"version-string": "2019-01-09",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b568d33cd1eef6b6a4d92453b5696bc3695b9ccc",
|
|
"version-string": "2018.09.30-b887974",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d90d3c81ce26b81b32d7a715029af1f1ecf728e2",
|
|
"version-string": "2018.05.07-48c9554",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b3d734474a1bb342f3aae211c823b0d16057014e",
|
|
"version-string": "2018.01.01-5579ed1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8671cd8c7b9dafa896470a769ca95f220b2d9ea0",
|
|
"version-string": "2017.01.02-1e2960f",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|