mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 14:59:05 +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 ```
50 lines
1.3 KiB
JSON
50 lines
1.3 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "9eefd1250090f0a85e48d86a1d25f226e1a978d3",
|
|
"version-string": "2020-09-14",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "f5c6cb1d6373706ec11daef580be154ef47e1bca",
|
|
"version-string": "2020-09-14",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "cb4fa3fe24b06e50b605ddb9cf8cd5a8bc8dbfe1",
|
|
"version-string": "2019-05-07",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "64220c3a2b8ea025f824547042c207ec4476d624",
|
|
"version-string": "2019-03-29",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "5512c2711e107896ac325387471d8464b93b18dd",
|
|
"version-string": "2018-09-18-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ad15f76b27536c67d625eb4f666be8c31b83c28b",
|
|
"version-string": "2018-09-18",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e5872935eeaf007d23450259533f94645bb3d84a",
|
|
"version-string": "2018-06-12",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6cb2f911f54970a1567a8a5346ef511825164aed",
|
|
"version-string": "2018-02-25",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "27ef55e98ba32a9410dd8f59d5b17576674b790d",
|
|
"version-string": "2017.05.25.5a17f79b0301f0a1b4c7f1c73388757a7e2ed309",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|