mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 03:30:38 +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 ```
80 lines
2.0 KiB
JSON
80 lines
2.0 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "58fca5af8a14714f953c3d8a4653e90ac8d11e2f",
|
|
"version-string": "2.8.2",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "a170553c57f438bdab8cde9f4c6494e774763681",
|
|
"version-string": "2.8.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "25d338809366c358afe158e52694be2a670ab054",
|
|
"version-string": "2.7.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "754905c9baebd27cf1312f7054403f3e901d5d53",
|
|
"version-string": "2.6.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "64e373a8e9115c984f399afda24a437ace26b4ba",
|
|
"version-string": "2.6.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "51246db8056526db6c835be4c7696ebeb3510595",
|
|
"version-string": "2.5.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6b0d0ecb2631cfb977ee4455273cc61edd505295",
|
|
"version-string": "2.4.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d24ee3a6772134b4075509cb0c968112d0d4cfa5",
|
|
"version-string": "2.4.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6b0d0ecb2631cfb977ee4455273cc61edd505295",
|
|
"version-string": "2.4.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d24ee3a6772134b4075509cb0c968112d0d4cfa5",
|
|
"version-string": "2.4.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1828a39a6c5ac19533b15a24b0bd9de8328eff56",
|
|
"version-string": "2.3.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "257a3d0cfb2b03dcadc647145e776c1892966d79",
|
|
"version-string": "2.2.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "890613b2325cf744c650259aabccafa0b0fdd3b6",
|
|
"version-string": "2.1.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2848e553555ffa2cc32e17e8613511a042a212b6",
|
|
"version-string": "2.1.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "01616c4f432067367bd0c4786e44667da33bcd81",
|
|
"version-string": "2.1.0",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|