mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-29 07:08: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 ```
50 lines
1.2 KiB
JSON
50 lines
1.2 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "e03158776f244589d6af861b4ceefabd4cd9fd12",
|
|
"version-string": "2.13.1",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "73e4996b95f57b891a1c4a85cd579297a55ac148",
|
|
"version-string": "2.13.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b9abe1e8d0e3ba2909d4f38ad609efc2788aa44b",
|
|
"version-string": "2.12-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2e471e8a19dcebef0b4b509d0544b6adc1492cea",
|
|
"version-string": "2.12",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "716161fc094b6f664ac4e6bb32f6618c205268ec",
|
|
"version-string": "2.11-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "5fa6027a192e9e5d9b2caf2f1a120591d00e0b51",
|
|
"version-string": "2.11",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0c2aef0c66564e632b25d756b066d07103bd5e32",
|
|
"version-string": "2.10-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "81a840970f4c7ee50becc01b7a2f582394e5123c",
|
|
"version-string": "v2.10-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a8ce624d53c0457c809d5c9d77628daacf55ebc7",
|
|
"version-string": "v2.10",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|