mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-05 13:29:02 +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 ```
85 lines
2.1 KiB
JSON
85 lines
2.1 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "3904d5293aad0e38ee7ca93b82182441bb1575ca",
|
|
"version-string": "3.4",
|
|
"port-version": 5
|
|
},
|
|
{
|
|
"git-tree": "39318069e894d5dd6ff63112fd707c31b13be88b",
|
|
"version-string": "3.4",
|
|
"port-version": 4
|
|
},
|
|
{
|
|
"git-tree": "aa119fefeb5d57dd2b34ec63ea94942f868f1d94",
|
|
"version-string": "3.4",
|
|
"port-version": 3
|
|
},
|
|
{
|
|
"git-tree": "6323296cab664ff847a474065dd4ba983c742781",
|
|
"version-string": "3.4",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "9dcbd561136f877ea90a21d6416b9a83ffadf331",
|
|
"version-string": "3.4",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "0aa27c05994fc03948def72785fbf82202abe568",
|
|
"version-string": "3.4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "874d7a8fa2d4fa5bbb7e5e4dda1b5d2cd3466e9b",
|
|
"version-string": "3.2",
|
|
"port-version": 5
|
|
},
|
|
{
|
|
"git-tree": "6451554d5de4d6a5b74488b48e49aaebfae180b5",
|
|
"version-string": "3.2-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "89d345fedc36e30eca8cc975d0a75dd5eaf31149",
|
|
"version-string": "3.2-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a498e3895c78dd93c1ca869e6121868e0b710925",
|
|
"version-string": "3.2-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "595f8b44993620cc1859e056472bfe0e4f502ab3",
|
|
"version-string": "3.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "cca6bdc27cbab86bd831df220828798a3a4e5593",
|
|
"version-string": "3.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1140f2914a8bee5950f877b54126aa5ee228cbdf",
|
|
"version-string": "2.9-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2c978e438b969ba9a47bde43e1e5e0ade18ae416",
|
|
"version-string": "2.9-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4e7554949366cd448f10222b0ab3f16815836b2d",
|
|
"version-string": "2.7-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b08cebd92d975257d78f5fd8d1e5d19fd15989c8",
|
|
"version-string": "2.7",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|