mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-04 08:05:34 +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 ```
60 lines
1.4 KiB
JSON
60 lines
1.4 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "40c7773d4774034a567f4b9f5427e558afe66ebd",
|
|
"version-string": "2.12",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "0020f124dcd6fa36e8ab5edad1efc85c59c51a56",
|
|
"version-string": "2.12",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "87ed3cf04e19a238f357a256419016aa49f88eb4",
|
|
"version-string": "2.11",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4e242d8bd5a56e9b1fd9e661e567637a3b873d3e",
|
|
"version-string": "2.9-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c081826f7e7ab6f0f77815ef977490591d4cefae",
|
|
"version-string": "2.9",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "491f74ae0cec150e607d4db92988afb65aed3abd",
|
|
"version-string": "2.8-5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "de7e09d6231f0050332d407b5f8a8aaade48c74d",
|
|
"version-string": "2.8-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ba9083b1dea6641f5fb0aec0dea313df5b2e6562",
|
|
"version-string": "2.8-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "02fd4bbb01ea5b216ef0bacb1c14283e274d2d35",
|
|
"version-string": "2.8-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "02fea392ed5fca378b02fcc2b94892d20407b45f",
|
|
"version-string": "2.8-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "297b72454dc0105b9f5d435afa08df98d8f76e3a",
|
|
"version-string": "2.8",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|