mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-29 20:23:41 +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 ```
65 lines
1.6 KiB
JSON
65 lines
1.6 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "bc5a003bcb8a42fc935726d0d8de55156318a3db",
|
|
"version-string": "6.1.4",
|
|
"port-version": 5
|
|
},
|
|
{
|
|
"git-tree": "c92d5a2ff87b2ffe3a78987e5c483abb537a0a21",
|
|
"version-string": "6.1.4",
|
|
"port-version": 4
|
|
},
|
|
{
|
|
"git-tree": "ab9a1a3260f20287848c12e673c0add58872b135",
|
|
"version-string": "6.1.4",
|
|
"port-version": 3
|
|
},
|
|
{
|
|
"git-tree": "4194ff455159af7503fc6c4d1d3c23fdee9cb1d8",
|
|
"version-string": "6.1.4",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "59b91118466283503dc6fc3e5706f51e641792be",
|
|
"version-string": "6.1.4-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a38429e6e13b9509825dd0d9a90505e2b702c6f8",
|
|
"version-string": "6.1.4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "7680bcc8036f8a9d9f2b415005990273c4368dcc",
|
|
"version-string": "6.1.3-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f719e0810eec4ead80974ecc24cbc16e3052e182",
|
|
"version-string": "6.1.3-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "bdd8983cc6713fd980f1238bcd355c48f73c448c",
|
|
"version-string": "6.1.3-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "bc0ab59cdb60cee111585d32ebd68b7a54f20cac",
|
|
"version-string": "6.1.3-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2128617e72276fe5b5b29eaef1586bffe0c879f6",
|
|
"version-string": "6.1.3-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "bb940abd3c3b26b525bb6ba2626332c83b132ed6",
|
|
"version-string": "6.1.3",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|