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": "fc9230cd12ff7d556e700053798f20e07283954d",
|
|
"version-string": "2.7.0",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "b41eff8a3d196467693d35957280cad3be6a7f4b",
|
|
"version-string": "2.7.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "83f140fc0183ab8a09b588d9ac3772e65abdb5ca",
|
|
"version-string": "2.3.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e425bc596d3b5863436c698b2d40fa293e1d2e68",
|
|
"version-string": "1.18.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3f47107a2a703b67df631f50ed54fa12ffc755cc",
|
|
"version-string": "1.17.0_libuv-v1.29-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e8da0f3cd9024396f4b5ce44a67e2f09ebc16b2e",
|
|
"version-string": "1.17.0_libuv-v1.29",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "66a436732bb4280ad5933b6343ef43f7203dd946",
|
|
"version-string": "1.15.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ef9a1c6f4bac4f2743e75e632f3f8cc5b47f5bd2",
|
|
"version-string": "1.11.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "29ac18a5b517fcf9646244a995acae6cf3d3ba04",
|
|
"version-string": "1.11.2",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|