mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 19:29: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 ```
60 lines
1.4 KiB
JSON
60 lines
1.4 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "5ff8f81870f8963dc86da05ce330bbde585e940d",
|
|
"version-string": "1.0",
|
|
"port-version": 4
|
|
},
|
|
{
|
|
"git-tree": "012f601b9fa99d1f7ea32a3df809599863bbfa5b",
|
|
"version-string": "1.0-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "bf030396c323fa52c93b2c8d45a5e699de83cd24",
|
|
"version-string": "1.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "54d402ddc00e5af4a6087bd5464fad1b75e10558",
|
|
"version-string": "1.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "903943c93948e7b38d2a29d1507f88820d19ab47",
|
|
"version-string": "1.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6f473076f1186ad7ab2c93031a4447f4f6ea85fd",
|
|
"version-string": "0.9",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8df530f314232043532935cee19687cd4c4985aa",
|
|
"version-string": "0.7.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b9ae660e925434f359284fcdf7f5c0c32904471c",
|
|
"version-string": "0.7",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "fcd76753d8382f91db81e9b768408931640045b1",
|
|
"version-string": "0.6",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9d2b4125a3bd79fbab80fefa12ab3628875c20da",
|
|
"version-string": "0.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "40bac513282c377219e3192b78a25b931b92c085",
|
|
"version-string": "0.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|