mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 15:59: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": "dd8e1026af78ffd7bb4e9d6fa1455579367206e1",
|
|
"version-string": "1.2.15",
|
|
"port-version": 14
|
|
},
|
|
{
|
|
"git-tree": "3577dacfb219c514fb37b44ac83b8d9d379ec828",
|
|
"version-string": "1.2.15",
|
|
"port-version": 13
|
|
},
|
|
{
|
|
"git-tree": "03794252b766a260a14f3584af5004bd0c12090c",
|
|
"version-string": "1.2.15",
|
|
"port-version": 12
|
|
},
|
|
{
|
|
"git-tree": "71cce08b24aa037121be28974a319709e9c0e176",
|
|
"version-string": "1.2.15-11",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1f13d2e6f240e80f47de718b6859c9abb12c89e5",
|
|
"version-string": "1.2.15-10",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "fdc874ddaf771ab4a6723cdac2353409ca2b5eb9",
|
|
"version-string": "1.2.15-9",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f3f8bf61ba5f6afcc389c121fc1d2918ff41ad82",
|
|
"version-string": "1.2.15-8",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "609d10b833914dfa8777d25d11839518f299f89d",
|
|
"version-string": "1.2.15-7",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "340f747ec27b9f185ff2a18feb81662312ad6163",
|
|
"version-string": "1.2.15-6",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "65749f840b425f62ed85c486a2726a9d708aefe0",
|
|
"version-string": "1.2.15-5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ae6882c57d24d69af18a48490531ecb49c86a4c7",
|
|
"version-string": "1.2.15-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "fddf602560bf3f7d23e5c4c83813611d4bfea2c6",
|
|
"version-string": "1.2.15-3",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|