mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 16:39:18 +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": "8795a94d25adbb75d3be0b191bc3c15321e9c686",
|
|
"version-string": "3.8",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "0929cccabaf3511161aa06789a414a2937629679",
|
|
"version-string": "3.8",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "0a3d771a22aa157efa6509d71ca490c0837245ba",
|
|
"version-string": "3.8",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "030ff934e5ec3edf938b5c7af9ee2d0aaf2312a3",
|
|
"version-string": "3.7",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "31cd07691fc311e7162d87a5fa3a9c57c1394a45",
|
|
"version-string": "3.7",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c8c9bc05c29ce0eb5f92c342f55769350f3b05cf",
|
|
"version-string": "3.6-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "601997a4170c6ae1c3abc833b9903ed3d8e76074",
|
|
"version-string": "3.6",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0c07a59546a7c2c5f1192e0bff318c9df2ce248c",
|
|
"version-string": "3.5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3f72a5942a99dd91142e5abdc1baa783330b127b",
|
|
"version-string": "3.4-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f26995e1fb9fe7e85ce58eca839126c280b6e46e",
|
|
"version-string": "3.4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d00bace3480f1f01ac244f1d0a81588f1bbfa8ba",
|
|
"version-string": "3.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "637fc709acbb54db8d3cfbb6f3ac10ec93870ed2",
|
|
"version-string": "3.2-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e472a441bdfffb537058d7aea7c67e3221053c38",
|
|
"version-string": "3.2-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1e22d37bf1c1ef3d5f76d12d917f30d39da28897",
|
|
"version-string": "3.2-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "15ef5588a761e515cf91f2527cffe3f9f9387f03",
|
|
"version-string": "3.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d2ec68e6acec03edbe7a55b3fa317f104e74c859",
|
|
"version-string": "3.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|