mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-03 11:19: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 ```
45 lines
1.1 KiB
JSON
45 lines
1.1 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "0828484bab48f23c09e440f9df3d9d99dd3caaa0",
|
|
"version-string": "1.9.2",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "09783bc724dc91b8c456cbb060043ccb206e8595",
|
|
"version-string": "1.9.2-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "99bbfcf0dc88ff4fb93fee1e252a1488d0be5bdb",
|
|
"version-string": "1.9.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c6e0d310e5ed9c1cac48a2076ba67323acf25882",
|
|
"version-string": "1.8.2-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "7946d8a20fa3d901dfdcf9a76c361a1c0f9b095d",
|
|
"version-string": "1.8.2-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "617a18c6d4bf8718e7010da2797c60f63fba082b",
|
|
"version-string": "1.8.2-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a3052db22f21a58023818a908d156fa4a9e4574c",
|
|
"version-string": "1.8.2-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ab59da4973872f333444eb0847dcc80abc5dd3a2",
|
|
"version-string": "1.8.2",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|