mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 20:32: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 ```
70 lines
1.7 KiB
JSON
70 lines
1.7 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "9809d05e16b0047099b1c43c4d81f5f34efe6a8c",
|
|
"version-string": "7.4.9",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "6a90c6aea234c06968da8f6c48ea73ae7d95d28e",
|
|
"version-string": "7.4.9",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0fd573b8bacc1ecb86f0217b5e56b3014728f580",
|
|
"version-string": "7.4.8",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3e6166e2e3002cd05d19f31b75d6f30b8fc522ec",
|
|
"version-string": "7.4.6",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1081676020f0420bbd55208e78e3a76e6c2636bf",
|
|
"version-string": "7.4.5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4ade533d73c09e276c9852aa6cbfc6a402a93a23",
|
|
"version-string": "7.2.5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "97f76318034ad8cb1e78df717819307c1c0090de",
|
|
"version-string": "7.2.3-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "883ca27572ae59ed8e9b7c9c5873d05496c323cd",
|
|
"version-string": "7.2.3-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e5c8d8cce44724c0925f0bda642c0ede4553753c",
|
|
"version-string": "7.2.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d63d66240daca30beda311fb07787ee74e687007",
|
|
"version-string": "7.2.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f76bd91bf4c4dbe6d201c1c0107dc7e3f100465f",
|
|
"version-string": "7.2.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "265a525d8ac1a3b179deab85f56fb7444331781b",
|
|
"version-string": "7.1.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f7d40283b43d177d46727d1408706600ad8a60ef",
|
|
"version-string": "7.1.2",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|