mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 13:19:23 +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 ```
40 lines
978 B
JSON
40 lines
978 B
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "551e2b3f3b67283a71c20088413de576c9dc55c2",
|
|
"version-string": "1.0.0.27",
|
|
"port-version": 7
|
|
},
|
|
{
|
|
"git-tree": "09eeb5a939e4dcb87f405fea40875b2a803cd381",
|
|
"version-string": "1.0.0.27",
|
|
"port-version": 6
|
|
},
|
|
{
|
|
"git-tree": "f0a6e61554dbc2b0682711214e704f8fc04275ae",
|
|
"version-string": "1.0.0.27-5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ab492ea21f882355f542c09d471ef43261938b54",
|
|
"version-string": "1.0.0.27-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b9392b046528c7396df4c34de4d7316bd27d6c82",
|
|
"version-string": "1.0.0.27-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "543e2a29c62175b1c5b4ea9f4d9aa7cda3fd497f",
|
|
"version-string": "1.0.0.27-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "70b9f93698dd7325b4d9bbd32cf4b2f06a53d9c7",
|
|
"version-string": "1.0.0.27-1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|