mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 15:29:01 +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": "e7058d11b081c99f9be409c3770e9d41b6487505",
|
|
"version-string": "5.70",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "1214c3471adf4b1257484fe2b5e93c68f2be0d2f",
|
|
"version-string": "5.70",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d144aafa5bbed0987c741f1bde761eaf4b90af9e",
|
|
"version-string": "5.65",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "56550b410f187868315fdf13b9e389780197b511",
|
|
"version-string": "5.59",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "dcf7fc513c4fbbf553b6b5d8eaa457ed8ec8486e",
|
|
"version-string": "5.48",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "68712c31dad17b79f99908a8ed7885686281ee49",
|
|
"version-string": "5.46",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3cce5af184c45d17c3d5292d9d925ccce59b469a",
|
|
"version-string": "5.38",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "97e3095b7ae797b1ee4253942743584221edb289",
|
|
"version-string": "5.24",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9edf6a96cba59ac1c287e24911141e3f229f120c",
|
|
"version-string": "5.14-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "30872fc7b35dbb207f58bbe1604bd23bee0e8344",
|
|
"version-string": "5.14",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4894a97d8ba72dfb2fa3f7a88f0caaa814a660e1",
|
|
"version-string": "4.8.3-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d5c37550f5a0d18a7ec6ad70a3abc5f276bcd213",
|
|
"version-string": "4.8.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2de4b1bef0fc62fd5a6b42652db31c9de74765a9",
|
|
"version-string": "4.3.3-1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|