mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 20:49:48 +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 ```
60 lines
1.4 KiB
JSON
60 lines
1.4 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "0b8591ea0b8692c0c2963c468ee5b9c2e260ace4",
|
|
"version-string": "4.9.1",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "846cffb150c26539ce36129c5a45d7ce54e6a1c8",
|
|
"version-string": "4.9.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ed270bdb7075f6ed46cbe345c367ecb00ef64eff",
|
|
"version-string": "4.8",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "1c0f17bc114b3f94e31bd6ecbef4ee2457768b5f",
|
|
"version-string": "4.8",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8f10523941e1e8d75a88feb08b1e0b711ae98a03",
|
|
"version-string": "4.7.1-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6eb22d8be66dcd33b068f3fb25ae06445fd7dd61",
|
|
"version-string": "4.7.1-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "7b3883e70e318f9a15f4b27a9d71c26e7eb9d957",
|
|
"version-string": "4.7.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "bdcdb19ea351359d51b11e772fa396c90b014856",
|
|
"version-string": "4.7.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "34a4ebe35067164ad729d4b66e502c57271ec8a0",
|
|
"version-string": "4.7",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "984fdaa45d466efa9b2dd00661731a115e4c6292",
|
|
"version-string": "4.6-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "49539bff6d8bf30a96b0228ac27439d946b81dfb",
|
|
"version-string": "4.6",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|