mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-18 13:27:56 +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": "b108b8daeb1695db997a7ebc1b341e27d4d84ce7",
|
|
"version-string": "2.1.3",
|
|
"port-version": 7
|
|
},
|
|
{
|
|
"git-tree": "f534a55290d8bce0e7d8fd5f443550c4565a4b63",
|
|
"version-string": "2.1.3-6",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8af22f1b574a271ad022d4d15ce261a913d6f6f5",
|
|
"version-string": "2.1.3-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d3f77bce6db68e69e816ea95122a625c082b08c0",
|
|
"version-string": "2.1.3-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e50560ddf376a65ed799c20b617eebd8fb519e67",
|
|
"version-string": "2.1.3-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "560210636b2139272be5a80f64b56651180e77f7",
|
|
"version-string": "2.1.3-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ff164993a7b025594837f969f6efb0b17bde31ad",
|
|
"version-string": "2.1.3",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|