mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-31 05:03: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 ```
40 lines
957 B
JSON
40 lines
957 B
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "a42a5beba1ed982d3e6abb94ad6871f06f663d93",
|
|
"version-string": "2.0.0",
|
|
"port-version": 7
|
|
},
|
|
{
|
|
"git-tree": "11b7150cc88a598a42ce1467849d1138fb0540aa",
|
|
"version-string": "2.0.0-6",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "bd65cb2504c2c8212d11ccb603ce21d6aee9279b",
|
|
"version-string": "2.0.0-5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9b7899c89d213403142449e133911b5d03687d12",
|
|
"version-string": "2.0.0-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b4a1d9ecf0315d3c311279b789aa9c9dbec1d483",
|
|
"version-string": "2.0.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f2c913e246b0fc3ae49132f8a58b82e9443f25d2",
|
|
"version-string": "2.0.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b458b862ee758d38e46e5537eb557a1602f88cd6",
|
|
"version-string": "2.0.0",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|