mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 20:19:06 +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": "c170749f5731ca44674e241167fa0955a461256a",
|
|
"version-string": "1.1.1",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "0e0e15c0dc05913aa952e8d0ce68b145ce8cdfdf",
|
|
"version-string": "1.1.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3283a8e4667c1f13418f951e474d576a4fc01f88",
|
|
"version-string": "1.1.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f389d4282afd60d710f395e3aa3bff2a98e388e3",
|
|
"version-string": "1.0.7-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3f24ca27d2d2f730b51e320676248d41445342e0",
|
|
"version-string": "1.0.7",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "745d73eb1ee20976f49f7d256dab79b1b0c48afe",
|
|
"version-string": "1.0.6-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1e2099cd49db892b57d25113c7dc846d1a2b0fea",
|
|
"version-string": "1.0.6",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e827e0e16d52ac19ce656dd1456817eec645d0cb",
|
|
"version-string": "1.0.5-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "63c19d9c0702e151f94c895f074df8ae1d115c17",
|
|
"version-string": "1.0.5",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|