mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-28 13:49:39 +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 ```
65 lines
1.6 KiB
JSON
65 lines
1.6 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "b34153650a29eb81f88e48f53bd06ca05d4383c4",
|
|
"version-string": "2020-06-17",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "10a9af0e9e3e4d0a7ab3a5819943e4d609677c1a",
|
|
"version-string": "2020-06-17-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "97a7fdde215f5c129ca102a68bd6c31fb05dc625",
|
|
"version-string": "2020-02-04.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b3247368a3dd68037fa1f77de94e14e234cf16aa",
|
|
"version-string": "2020-01-22",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "27141636977218c8c9e394370759e07e001c9503",
|
|
"version-string": "2019-11-27.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "413299817381e00342581ecd2ad6badb98b4546c",
|
|
"version-string": "2019-10-07.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "043b06d9b9c58987c224353e26f03b208f5a7eed",
|
|
"version-string": "2019-07-01-LTS-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "76d07d1bbf56cb4c3c9ccc57cc95cc0f4a82cd2f",
|
|
"version-string": "2019-10-07.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4dab55f47de9332734363419362ba25949921308",
|
|
"version-string": "2019-08-20.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "dea5476a79d9d42c9ea126d914d3c7f73aa1c173",
|
|
"version-string": "2019-05-16.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8c524063e559683d4e74003302b2548dfbc3a157",
|
|
"version-string": "2019-05-16",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "99d6f1960217643a28d932f7c4c3e32e60b9f4cb",
|
|
"version-string": "2019-04-11-1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|