mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-29 20:23:41 +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 ```
55 lines
1.3 KiB
JSON
55 lines
1.3 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "8cd78baa4d8b7df9077f76b8f5d600aac6e09716",
|
|
"version-string": "1.6.4",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "80c6805ca7328eee7a8c27608e346274ff35baa1",
|
|
"version-string": "1.6.4",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "b44f348d787046b37705da0becdce9fb1d393778",
|
|
"version-string": "1.6.4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2b47da6da9cb6ecb63e13f9627cfb357dd37d64f",
|
|
"version-string": "1.5.9",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "7bbfb675224d29fdec16955f03a661f0b3e2e40c",
|
|
"version-string": "1.5.7",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3b6d0e65e8d7e3adb2ff90a8c414b93e6589338d",
|
|
"version-string": "1.5.6-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1e7103634a9e90132569389f622f5779f4ecb10e",
|
|
"version-string": "1.5.6",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "74e31baf6f2be9e22fbe0fdfa52e9da4896b7a7f",
|
|
"version-string": "1.5.5-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "77b88ea9af71142a497ca7f306265abb693c8ae3",
|
|
"version-string": "1.5.5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f94c29db60400ae93c843568ebc6b66103f46cc1",
|
|
"version-string": "1.5.2-f47e02c-2",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|