mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-10 05:49:30 +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": "e973009e3eb7bc949e546204441002d914aa8886",
|
|
"version-string": "4.3.1",
|
|
"port-version": 3
|
|
},
|
|
{
|
|
"git-tree": "17850b6ba47c047dc7e2e55bdb6b2956521d424c",
|
|
"version-string": "4.3.1",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "be1a100ea4fa132b206c23d21515a721d933889c",
|
|
"version-string": "4.3.1",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "37f045219c6b94d0f3df5aee1fa2ff22068e6ad1",
|
|
"version-string": "4.3.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "64bcda2a7fb352a6d5a571097d868fabbdc80897",
|
|
"version-string": "4.3.0-5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6c8bc2cd8515277be4284793d118b14baa780d61",
|
|
"version-string": "4.3.0-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b24f7fa7bd4bba4c2865d464d7ed9d499c1590d0",
|
|
"version-string": "4.3.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2d5fd97c9e7ce59dc22fc0b0382629373ab659b7",
|
|
"version-string": "4.3.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c50e548832c03140ac4af027e4b0fe8b53a0916a",
|
|
"version-string": "4.3.0",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|