mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-29 02:18:59 +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 ```
40 lines
953 B
JSON
40 lines
953 B
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "cf7d08eca18c0a361f4852847260da415a29fa29",
|
|
"version-string": "4.1.3",
|
|
"port-version": 5
|
|
},
|
|
{
|
|
"git-tree": "c30934172813869e2864463acb7b83cd8f4b2ee6",
|
|
"version-string": "4.1.3",
|
|
"port-version": 4
|
|
},
|
|
{
|
|
"git-tree": "b3e75100dc98cd912247d1a5eff621c8d5555550",
|
|
"version-string": "4.1.3-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2bd18cf8b182b233103acf0243c47406aa40d935",
|
|
"version-string": "4.1.3-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "dd8af2fa94978477cea3e0f64fe41e01c487c6da",
|
|
"version-string": "4.1.3-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1c722067bbff3822db6d4df7c2b7cd16a9717406",
|
|
"version-string": "4.1.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "05bd2e490fc9ccb90b4655c773ce545a284c88a8",
|
|
"version-string": "4.1.2",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|