mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-06 01:51:36 +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 ```
35 lines
835 B
JSON
35 lines
835 B
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "28abab182be22ac70207027a6a7e206416bd28b0",
|
|
"version-string": "0.13.0",
|
|
"port-version": 5
|
|
},
|
|
{
|
|
"git-tree": "52deb7c24c307a3089b818d3b35bd7b19b1e4dc2",
|
|
"version-string": "0.13.0",
|
|
"port-version": 4
|
|
},
|
|
{
|
|
"git-tree": "8a0b0215fd6f8ac92b1ef9a159531840551c8dbb",
|
|
"version-string": "0.13.0-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1eec50f9389302cc76df41306d01d955f5a67d22",
|
|
"version-string": "0.13.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b3f4a127b4bb5ce74bc1081465c12c7ab0da1f75",
|
|
"version-string": "0.13.0-final",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c87e2c49f00112069635fddc0d0b4b24ce9e3036",
|
|
"version-string": "0.13.0-rc3",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|