mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-30 12:59:06 +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": "8713e87cf40c60307dfdef2102392b97cb3b4c3d",
|
|
"version-string": "1.2.0",
|
|
"port-version": 9
|
|
},
|
|
{
|
|
"git-tree": "eaa4e7b1a075051d8ba02bc67a89ae035be1b28c",
|
|
"version-string": "1.2.0",
|
|
"port-version": 8
|
|
},
|
|
{
|
|
"git-tree": "ee8363b22602ef2b0f74d4d43de88ed32457c4ba",
|
|
"version-string": "1.2.0",
|
|
"port-version": 7
|
|
},
|
|
{
|
|
"git-tree": "3cee82112765f15b171e6cd1c82d8b6dfdae8d0e",
|
|
"version-string": "1.2.0",
|
|
"port-version": 6
|
|
},
|
|
{
|
|
"git-tree": "374b39093074f2df35ddc5d149b6be0f341dd512",
|
|
"version-string": "1.2.0-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "cf094b8180941583f404a7d7a448a8e19680d3e3",
|
|
"version-string": "1.2.0-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "69ef4e65fe6345c928392beab80b47a93654bbb4",
|
|
"version-string": "1.2.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2ee5d2b6a00e5189df97b91e2add1e06a730193c",
|
|
"version-string": "1.2.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1e2b2cbc8fb9e7557b5e5e54e8421fded8616ae7",
|
|
"version-string": "1.2.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "95a26111514fae470f4b23b0c0e63441ee0a8b1b",
|
|
"version-string": "Speex-1.2.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "425d2c37fa67478fda173254b059df04db437d83",
|
|
"version-string": "2017-06-28-cae5026cfd88782c7051af6e685059223578b7e9",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "194d58d3ef9d94580d5bf822978a41c6cab80722",
|
|
"version-string": "",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|