mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-03 03:15:22 +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": "1f19c23c1d05692cdf45c9876efc195412945dae",
|
|
"version-string": "3.6.3",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "fbda394a196627494c8b9f50362ebf0de3bf1be6",
|
|
"version-string": "3.6.3",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "7aa1c3456d0dac65c1144b54ae721a9bf451c004",
|
|
"version-string": "3.6.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c6c5b5931a1d533ac9c5351802af2f423c6d30f5",
|
|
"version-string": "3.6.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a119e464d2aac3be67ecd86d71dc3dd2ca2db09a",
|
|
"version-string": "3.2.5-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "90d0673a8336f98da502391565b0e049929da396",
|
|
"version-string": "3.2.5-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2d1947bfcb7238b79f0f651da6dc6abce691581d",
|
|
"version-string": "3.2.5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "96e7fef0023550b6a5f39b2c0239a90504f4d904",
|
|
"version-string": "2019-08-14-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ccf34e51c29d798a6d7dd618271896b234844f04",
|
|
"version-string": "2019-08-14",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d38fb388ca2588651e9eec198b59d733b87d3345",
|
|
"version-string": "2019-08-09",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|