mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 03:39:06 +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.4 KiB
JSON
60 lines
1.4 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "174f5bc4cc8080f2cb34c7a1aad9b14bedaa2c9a",
|
|
"version-string": "1.13.0",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "f5e980fa829d4bd732381378c07ab88cb7b2c969",
|
|
"version-string": "1.13.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "05cd6beca4ffc47cdd618838be06f0ae979a56b9",
|
|
"version-string": "1.12.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c05be5836d2f25969eaaf145126836c6e18011b4",
|
|
"version-string": "1.11.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e5f5bd252f928a1a81b2befe404617906c9b487a",
|
|
"version-string": "1.10.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8676d5dfc85f85f5fde6e3f223818d1a89d44fc1",
|
|
"version-string": "1.9.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c780902451f439d276d13dc4360e5eedac8b0acc",
|
|
"version-string": "1.7.5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ade89e045541cc0b8c35393f14a6344dea2c0f6b",
|
|
"version-string": "1.7.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "66ddce862691ffe1f339a607eaaeb9dac247e5de",
|
|
"version-string": "1.7.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "77fa2480eb705b8818e404d7bc87c94c4e51a858",
|
|
"version-string": "1.5.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e336acb4ff76d32d20792c7250dd5c3f0116bccd",
|
|
"version-string": "1.4.3",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|