mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 19:29:08 +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.4 KiB
JSON
60 lines
1.4 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "9aaa215768207c8c514a9a5f8be8e0ec6f5e8f02",
|
|
"version-string": "4.1.0",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "018dd4bf16d8a68e161eef8459458d2de47a125c",
|
|
"version-string": "4.1.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6243560127ca086b89812f77a6635c8cd38fcdc4",
|
|
"version-string": "4.0.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e8afef56a008634916bc97eb11ae79ba02c695c8",
|
|
"version-string": "3.1.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "aa109abb93ccccb6e16c83b7e7e323377094b49b",
|
|
"version-string": "3.0.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2929abc521658db78cfb040189b3f9cab861e5b6",
|
|
"version-string": "2.4.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a2a38e076c6733520ed2bc4486bb7c5ffa2b7cab",
|
|
"version-string": "2.2.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4b4b7fde7bb3dc5fcd3087cbaa8cb9e9864254e7",
|
|
"version-string": "2.2.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "49452133f986be20d1d7719e33863c2369e1c899",
|
|
"version-string": "2.2.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6319c821321e937278e2ffe232f1e401ca6f2674",
|
|
"version-string": "1.2.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8a41891db9540f656840ad027a57d5131f96facb",
|
|
"version-string": "1.2.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|