mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-08 01:41:38 +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 ```
70 lines
1.7 KiB
JSON
70 lines
1.7 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "2af3faa6e86d241d2d6845f27c21afa51741f391",
|
|
"version-string": "1.11.4",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "64fda47a7f4dd9fc10c60169c4f5e0b069481199",
|
|
"version-string": "1.11.4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3c0bf3af0be3a7df2f1ee8f65223b6fc49947b35",
|
|
"version-string": "1.11.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b2456795dd215d7a7775984b64996f0c63ea648e",
|
|
"version-string": "1.10",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "1c0655bd501db1da226ba12180dbeb6f4645a7c3",
|
|
"version-string": "1.10-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "54835b7790a7ee53620c213ace1723e4c5e3e2fb",
|
|
"version-string": "1.10",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0236ebae3c255e33c652036790e73a756175cc0e",
|
|
"version-string": "1.9-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6eedd01c350f4bef43b2cfe7dfc453d865f13046",
|
|
"version-string": "1.9-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c941bbc462bcab3fa94dbe6a464f5041e16a7c9a",
|
|
"version-string": "1.9-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a3f8bcd5da3737d17a806dd44bd504bffc3ac8d2",
|
|
"version-string": "1.8.1-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "aafeef62ceacb7e3114738e843ba3d2b906af16b",
|
|
"version-string": "1.8.1-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "172398557141361c21be1283417b6b2c47eb183e",
|
|
"version-string": "1.8.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d01042f4857496f4e0905565298e5412000da32a",
|
|
"version-string": "1.8.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|