mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 10:49: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 ```
90 lines
2.2 KiB
JSON
90 lines
2.2 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "c0f3cb1b07b4ac8c05297fd8c438ba7e1ba97ed8",
|
|
"version-string": "5.15.2",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "55332e79db24457e25edd53505c1ada54b6c8ff6",
|
|
"version-string": "5.15.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e89068f3afab69f11461a0bcc2153368af489051",
|
|
"version-string": "5.15.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f9d08f684f3a48174fb02f4ce6ae55aae906b095",
|
|
"version-string": "5.15.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6a4deeee9d9a81e41dee958b9ad3562e6a099c23",
|
|
"version-string": "5.12.8",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d95e7bee74808d300eaf2a6b882ae55506204622",
|
|
"version-string": "5.12.7",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "afb1b1e0b10ae2029a093afecd1b3ba851162aad",
|
|
"version-string": "5.12.5-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c1b20474e08df4155b3745d69a5381b2f296c256",
|
|
"version-string": "5.12.5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b1aa7372bc1643fdff3167b433db9d7b86fb2c05",
|
|
"version-string": "5.12.4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d005163818908c9059fa8bd775625620ee599bcd",
|
|
"version-string": "5.12.3-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6e58b344f8789ebbe11d739e129a0fd08ab79bba",
|
|
"version-string": "5.12.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "da8dce867a92e76be0a8d1ddd007fbf201540e6a",
|
|
"version-string": "5.12.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "30a3f39b7a851e0549d8a348e8b754a5a9350037",
|
|
"version-string": "5.12.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "5cbb594cae7cedd42d0669495a2312f630bd244f",
|
|
"version-string": "5.11.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "530798ac6ddcea00ac9df84208941db63f1fe333",
|
|
"version-string": "5.11.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "84049a65cfa313905849dcdd8f63a47fec579102",
|
|
"version-string": "5.9.2-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c193b5a40619c8e8bbce4d371199367d89c774d8",
|
|
"version-string": "5.9.2-0",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|