mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-29 11:41:36 +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.2 KiB
JSON
50 lines
1.2 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "572562b44cd15b26fd8cdf68dff2c53d6ec0619d",
|
|
"version-string": "0.60",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "96028362edb1da213edd2423d2c128e08ac6988d",
|
|
"version-string": "0.60",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "44ea18d7420266e2ad58a70271e5b245b1df39ff",
|
|
"version-string": "0.59",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4498eb2c19d26e1f55e12caf432aee24549e6551",
|
|
"version-string": "0.58-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "70b65aef4e7e6bfe62fb8666665f5f73c9aead11",
|
|
"version-string": "0.58-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0522191e6b44a1d85dc38e604d0ff354b314f393",
|
|
"version-string": "0.58-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2ce6e5634663f291d8debf2493e983797bca5abd",
|
|
"version-string": "0.58",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3481de23b7ccd787ea7cc1d890b2c234fab74dec",
|
|
"version-string": "0.57-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ec276851839e0916bf7459ed47ba53229e400d2c",
|
|
"version-string": "0.57",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|