mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-28 14:49: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 ```
65 lines
1.6 KiB
JSON
65 lines
1.6 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "35e7c38229f3ddc1e59be044e8daa29afc650f99",
|
|
"version-string": "1.1",
|
|
"port-version": 5
|
|
},
|
|
{
|
|
"git-tree": "a14a8fbedb0cb071c7f6b3d97d3c12d6c27f678e",
|
|
"version-string": "1.1",
|
|
"port-version": 4
|
|
},
|
|
{
|
|
"git-tree": "a3980b27c42afe4b46828474dbcb9f437a146277",
|
|
"version-string": "1.1",
|
|
"port-version": 3
|
|
},
|
|
{
|
|
"git-tree": "bdda2ff3955cbfb88b1c6e01c4a0e93bfc83ee99",
|
|
"version-string": "1.1",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "ed4b73a8b7ab475adbd6e9e5687a3a1b19e5ac11",
|
|
"version-string": "1.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b8d1e61c4d3181ce856bd523cf945db5c8745e9e",
|
|
"version-string": "1.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ab9674618d5be3bdee82a346d61405c197e54ea9",
|
|
"version-string": "1.0.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0b98e0933ecd22a0c68fdaef399787d309128b43",
|
|
"version-string": "1.0-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4594f8d9f4b736d1da6f077ace0266cef786c4d0",
|
|
"version-string": "1.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "cce3cd32d0a5e1e3a593c3a81cf1fbc48338c2bc",
|
|
"version-string": "1.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "49e67439d3c81dc1470f43dd03e03d2594e05f75",
|
|
"version-string": "1.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "241fc2e2e0d9bc0fcdef733430b237498f0ffa82",
|
|
"version-string": "0.9",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|