mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-29 01:03:19 +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 ```
35 lines
821 B
JSON
35 lines
821 B
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "ab5e52242e8403aa8b9b26a60baead129e2a1798",
|
|
"version-string": "0.5.2",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "997a41f7096c82db4bb868ade39fc8d51aee3569",
|
|
"version-string": "0.5.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d2a204620305b4d18cfc6d564690648dc18ff299",
|
|
"version-string": "0.5.1-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "37c75c1136f56e613bd4c90cbeacc9836657a730",
|
|
"version-string": "0.5.1-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1dc847e3cd1c293d01de31160de3ddacb197bcaf",
|
|
"version-string": "0.5.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "800b496ce65afb3c82c9708013aa07cef1f511e5",
|
|
"version-string": "0.5.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|