mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 19:25:27 +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 ```
75 lines
1.8 KiB
JSON
75 lines
1.8 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "574301a0f60d743f5ea7165dda5e45bd0f1082ba",
|
|
"version-string": "8.0.2",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "248e6da5d026e3d25975912d727d35612b32f5c1",
|
|
"version-string": "8.0.2",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "a126a4ddc8a30d5e50f27579acf06af3436ef6ed",
|
|
"version-string": "8.0.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "99b577e0925df3c88a9abcc5e2a2419ba44cb719",
|
|
"version-string": "8.0.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e00559523bd9ee2c0ca68795b8b6113e0e495983",
|
|
"version-string": "7.3.2-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "536421b63cc012330f22b0fda37006f154a0539c",
|
|
"version-string": "7.3.2-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ab01d658af2ccc2c47032fe3af45186d5c8b3795",
|
|
"version-string": "7.3.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "60b3b0b745477d4ab489edeaa96b353087da1c48",
|
|
"version-string": "7.2.1-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9b921f8f0feebdc148c80f30d18f46aa5d18d19f",
|
|
"version-string": "7.2.1-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "36fe7997ac50f395f0cd4d18a3abdd5718d169a8",
|
|
"version-string": "2015.2-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1e1b5fda40b57a87b1d3745c497892c900a5fb98",
|
|
"version-string": "2015.2-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8478f3531d966b213c554e4c0f46d07e3bbb1c15",
|
|
"version-string": "2015.2-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8998401aa6626bc4f6bdd831afaa3e9682bc3269",
|
|
"version-string": "2015.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "308526ae28d9f0eb0feb287ed138cf2516138b5c",
|
|
"version-string": "1.0",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|