mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 11:28:59 +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 ```
60 lines
1.5 KiB
JSON
60 lines
1.5 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "a68475211755b3999de8cb2ec1d2fdfe9bb8ab10",
|
|
"version-string": "2.24.0",
|
|
"port-version": 3
|
|
},
|
|
{
|
|
"git-tree": "f1591b930b769b43c14a193282eb85e9a7c51a47",
|
|
"version-string": "2.24.0",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "8b510a700284731a6f552ff2cd874794af4032ff",
|
|
"version-string": "2.24.0",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "d5a4ee1c525b9ac5197b86bfe553a1909ce9afba",
|
|
"version-string": "2.24.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a35e1a54c5d31e8ccab0117701402c9def267cdc",
|
|
"version-string": "2.16.3-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "7ad457ed5e067dc3b10a43c0820be065d081e242",
|
|
"version-string": "2.16.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3c353cbdd327d54fe0b94e5ca8395b8c4a184f31",
|
|
"version-string": "2.16.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0e219bef6b56d1650c6b21b604383861d397cad7",
|
|
"version-string": "2.15.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "eb1ec65bc6251b470991182e2184dc5c575169e3",
|
|
"version-string": "2.13.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8576d9c7a8e92c598c0a47950f71bd4e50cbb2b3",
|
|
"version-string": "2.12.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d151786b2020882f2711b617872b7f13234bd03a",
|
|
"version-string": "2.6.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|