mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 15:19:07 +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": "dd2473115d2b12883de5a00cdbb2aaa309702042",
|
|
"version-string": "1.1.5",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "7c34c7f065f811d99fe3aa30bbe84f9ac580c0f8",
|
|
"version-string": "1.1.5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3bf349ff0faa032132a525d7a5d429abd21efb8e",
|
|
"version-string": "2019-03-29",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d1cce1303a06e9ea2c9bcf3be072ac630ace5fa2",
|
|
"version-string": "2018-11-01",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6b3700225424235ebd6eae6cca857ec4d92be7d0",
|
|
"version-string": "2018-10-25",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "56039d7150142cc0ddd2129d2dcaa5b8a409af71",
|
|
"version-string": "2018-04-02",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d5de4c5a95aa6725296b0613502b0bf153f3bc69",
|
|
"version-string": "2018-03-23",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "95a83230895abb9f527a57f9cdecc0b8df3cac72",
|
|
"version-string": "2018-03-11",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ee4d136f6a2815d7b3acc7faac7a89bba5a503e8",
|
|
"version-string": "2018-03-07",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "24d857fd302406c577b0ec7bbb84154f134dafd4",
|
|
"version-string": "2018-02-25",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "dafbbb9fd26a25e9d757f0d29ab471066aceab44",
|
|
"version-string": "2017-07-20-9661f2b4a50895d52ebb4c59382785a2b416c310",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|