mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-05 19:29:00 +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 ```
95 lines
2.4 KiB
JSON
95 lines
2.4 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "8a169239b58831cf291de837dc26a357585136d9",
|
|
"version-string": "1.1.1h",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "526d4688d5ca8cdcbac22b8ff18f9aac10a8c695",
|
|
"version-string": "1.1.1h",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "3243016be13f2cd1c0ab38519b59f4660770acf5",
|
|
"version-string": "1.1.1h",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "22c37a71ae89dd3856bb6c81f0e59f804873acba",
|
|
"version-string": "1.1.1g",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "054a2e92258c48208eecda2bdbc32c9dcdc52dfb",
|
|
"version-string": "1.1.1g",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3918271375b0ff99b187ef3d357b3d391bc42050",
|
|
"version-string": "1.1.1d-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "dfe5545ce043f440d9d4ab06e7548c495b334e36",
|
|
"version-string": "1.1.1d-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "aa4cf0f1e723b452cdfce53989bbf73bb4acc847",
|
|
"version-string": "1.1.1d",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "911361ba8124500e840b359ab0972887b65c69ae",
|
|
"version-string": "1.0.2s-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "cab1a598632203ea232d8794fe1cb0d9489c62ee",
|
|
"version-string": "1.0.2s-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3c70e410a627bb3b67a34c0d8e79f784641f7dea",
|
|
"version-string": "1.0.2q-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4f32bcc4a79399ed840a045165a572d7c16446f9",
|
|
"version-string": "1.0.2s-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d3793cca46af28305e662afcf896e55b73396638",
|
|
"version-string": "1.0.2q-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ec5d01d75cd9ab48966220fdb644a63764c30cea",
|
|
"version-string": "1.0.2q-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "12c1959ae6532da0ad5d6531d59eb107c9f94df8",
|
|
"version-string": "1.0.2q",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6f75c8b4121807afd813459d36d752c019cdae8b",
|
|
"version-string": "1.0.2p-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "35f88f577589285a0a1cf5346fc1a2e71260eacd",
|
|
"version-string": "1.0.2p",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "508bde2de594176023af6270986da999919ab8af",
|
|
"version-string": "1.0.2o",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|