mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 13:48: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 ```
55 lines
1.3 KiB
JSON
55 lines
1.3 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "f3599ec6a6285945a3eeeac1f9b0db810855ec5a",
|
|
"version-string": "0.9.24",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "43467ce2a21ad30b6939a72fd6917e9a97209927",
|
|
"version-string": "0.9.24",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3bc5ea2e7aacd9ebdb567cf9bca7756147bda1f7",
|
|
"version-string": "0.9.23-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b2e32cf4c4db4be02625aab64908802fad87fed2",
|
|
"version-string": "0.9.23-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9c44f0cc6905c71f238d62ecb4cfaa6e85e61a20",
|
|
"version-string": "0.9.23-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "59e5125cffea0fdb742c0b94c3987a76b9af803f",
|
|
"version-string": "0.9.23",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "30af10fbae3e9fe693487c6e60e1dca1f8134eb9",
|
|
"version-string": "0.9.18-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "44f1d76b227cb18ee1ed69b58640749fbe2d64fd",
|
|
"version-string": "0.9.18-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ba36e3bbc32ee3e0ecfcd24541fc1c97dc366ffc",
|
|
"version-string": "0.9.18-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6198a0508824db389b0f16af52a47ae0bdebab01",
|
|
"version-string": "0.9.18-1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|