mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 08:19:01 +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 ```
60 lines
1.5 KiB
JSON
60 lines
1.5 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "7d72d589a9281315c0e7ee4b9dd697b7147c0258",
|
|
"version-string": "1.0.18",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "6674369c2498960b44d097881c3573857a7da92e",
|
|
"version-string": "1.0.18",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "0ba3ab397dde99a678c135d6fd91e42966bf8d88",
|
|
"version-string": "1.0.11",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "7b2841ace9b21323ca8adf567c41f91cbba1424f",
|
|
"version-string": "1.0.11",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ab1d69229690488dfcb745a7c2bcd817e85f3277",
|
|
"version-string": "1.0.3.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "7d247bd93984f440e73c207532a5f190e1d1c6a5",
|
|
"version-string": "2019-09-25",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "59a19a38c4f230b5b86d24034db3af01081cfae0",
|
|
"version-string": "1.0.2-0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a75220fa105691b3013ea8ab10a40e8955a59b65",
|
|
"version-string": "1.0.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a788de39d570996259910f0f03bb887918296fb4",
|
|
"version-string": "1.0.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "43f2f047ed9717d8d948ffe8cb73e9d322c79a0e",
|
|
"version-string": "0.90.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "bd0c957e3e6bd9e47141dc58147acfc25dc28ef8",
|
|
"version-string": "0.90.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|