mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-29 04:49:08 +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": "427341c7e75df558fc7fe5ff69340387877bddf8",
|
|
"version-string": "0.8.0",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "b0513b38c64783f4c9fe001b995f62a10f2e6d8c",
|
|
"version-string": "0.8.0",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "bf43ef4c3cf428cfc5c89e07008321caec66e923",
|
|
"version-string": "0.8.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "318c3d88579895b6b288694282494bb6ab366de2",
|
|
"version-string": "0.7.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "bab43952d557d7d33f36c79cb2644035eb7a939d",
|
|
"version-string": "0.6.4-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "313f9b028310d91dea6bbed71ef881640dc59891",
|
|
"version-string": "0.6.4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "bf8862a937ee1da793008dd671553e183e3a4e0f",
|
|
"version-string": "0.6.3-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "882693b8deea7d882395c29b0649008940ad7999",
|
|
"version-string": "0.6.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "21ced86901edd80f5dd31cdadda0017c86785095",
|
|
"version-string": "0.6.2",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|