mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-26 06:19:00 +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.1 KiB
JSON
45 lines
1.1 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "8f66cad42ef3e7749e345075f467f357ca061acd",
|
|
"version-string": "10.0.26.0",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "a8340b2c8379d1a6e0bbf5ae3ef2270074a2da2e",
|
|
"version-string": "10.0.26.0",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "85f47c87ba8461e3fddb5dfb28e4a89af683a989",
|
|
"version-string": "10.0.26.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2b1e8c7a20685587250e73aa5893ec257a85f24e",
|
|
"version-string": "9.1.23.1",
|
|
"port-version": 4
|
|
},
|
|
{
|
|
"git-tree": "16317ac71b729d2c2a13e6cf65c8c8f2f48175e7",
|
|
"version-string": "9.1.23.1",
|
|
"port-version": 3
|
|
},
|
|
{
|
|
"git-tree": "65524efaf89bd4c6dab638dbae6c2b86f56e5761",
|
|
"version-string": "9.1.23.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ee4d88eb9aa3687ca2e57d7f8e7db96876138668",
|
|
"version-string": "9.1.23.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2ab33a804638583554feaa279c52d5a0cc04a7f7",
|
|
"version-string": "9.1.23.0",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|