mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-09 20:11:38 +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 ```
55 lines
1.3 KiB
JSON
55 lines
1.3 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "4c8c5305bf3135855a29acfde1effc1f9897ea4d",
|
|
"version-string": "1.33",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "f4cfdf7841512d19a12c31705c75cbea341e5705",
|
|
"version-string": "1.33",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2366577284edc25897d22a701976455165f98265",
|
|
"version-string": "1.32",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "58bde5c4f3118de4aa1aa84b65a410b9d9f7e721",
|
|
"version-string": "1.30",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e17040bc5d348d6fcef6331003fcecbd62d51e3b",
|
|
"version-string": "1.27",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e10a56dd72865dda64f1f7f51496eb265355385f",
|
|
"version-string": "1.24",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "96dea928d3d99c17e0467cbe8e943f584c63b2cf",
|
|
"version-string": "1.23",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "00784adc08a483f035f6749e103a2e498ec57521",
|
|
"version-string": "1.22",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6339e1a753d776b89113f736eb15863e5535b9ec",
|
|
"version-string": "1.1.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "bf69e7f2e0369879c579aa635fbc220088f98a9c",
|
|
"version-string": "1.0.0",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|