mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-15 18:59: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 ```
45 lines
1.1 KiB
JSON
45 lines
1.1 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "af8c797ea264a95603d8d825a75d73d5cc408d4d",
|
|
"version-string": "2.7.2",
|
|
"port-version": 4
|
|
},
|
|
{
|
|
"git-tree": "73dd8e7a3f427ca6033c3836fac52ca45c4218cb",
|
|
"version-string": "2.7.2-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "331d62689bc20089845b9eb16879da8b5476b85f",
|
|
"version-string": "2.7.2-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "cb9c2b1899de5a040c513c481eee7e9359a598ea",
|
|
"version-string": "2.7.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b1e8df05c60f20beeb3c996adc159af5d533f74f",
|
|
"version-string": "2.7.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1d70b2578e1cdc442d8a2b3fbf03702875c268f3",
|
|
"version-string": "2.7.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8255c4861e262210c01f427f37475015a826c616",
|
|
"version-string": "2.7.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0cb31bfdefbf6ae0823317d39dad0d9e6becdec9",
|
|
"version-string": "2.7.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|