mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-30 12:39: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 ```
70 lines
1.7 KiB
JSON
70 lines
1.7 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "e718de4be5f3dcb0e0c7922a9ef7ef13bf5148b3",
|
|
"version-string": "1.3.1",
|
|
"port-version": 6
|
|
},
|
|
{
|
|
"git-tree": "9aa015835678b6dec3bf2a5ee904d68a746fac0c",
|
|
"version-string": "1.3.1",
|
|
"port-version": 5
|
|
},
|
|
{
|
|
"git-tree": "56ed75584e87d59f3c419a9f2b8829474afee37d",
|
|
"version-string": "1.3.1",
|
|
"port-version": 4
|
|
},
|
|
{
|
|
"git-tree": "0701ad56534e3c18e686371a5bfc9fde2ef8f064",
|
|
"version-string": "1.3.1-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2ac4d6df47768169434334ba7c9ef427e3f58a85",
|
|
"version-string": "1.3.1-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "bc57499bc60131c05e97c4084a2c65a39842a82a",
|
|
"version-string": "1.3.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e5486e84c33d611a3dfa0329581545bf84a5be12",
|
|
"version-string": "1.3-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0fcf47d7d3400428df93e819bfc31bcad9d57ccc",
|
|
"version-string": "1.3-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f0292b5f5b268707adaa680c46f048c4eefaaec4",
|
|
"version-string": "1.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "546e745df416ae092f16d7d4edab457fde66602e",
|
|
"version-string": "1.2.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6c7f2af37077b3ee742fd2a9fb09c92735e625da",
|
|
"version-string": "1.2.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1350305e4c5b98b320515033fdae069bd246273f",
|
|
"version-string": "1.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b34a853c028cce78b56af336ed90e1004409f1df",
|
|
"version-string": "1.1.4",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|