mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 19:39:00 +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
957 B
JSON
40 lines
957 B
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "dda1a742b2612d9d926fef9c804d5e5efd041777",
|
|
"version-string": "4.4.1",
|
|
"port-version": 7
|
|
},
|
|
{
|
|
"git-tree": "c69ae2b0e1c4730c75d66c8f842e0d8d3e4df116",
|
|
"version-string": "4.4.1-6",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4af756d98344e052d3bee919aec77b3a0079ccd9",
|
|
"version-string": "4.4.1-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "098f7f0e262147eab4c6159733d89c06804e4500",
|
|
"version-string": "4.4.1-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "78bb669d778cb055ad66d176ef52ada71f9cbcc4",
|
|
"version-string": "4.4.1-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f480b368906fbd946b97c743f8f206ced6ff55d5",
|
|
"version-string": "4.4.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b28380c69722d9e9887891ae8f3596d93ba4f3d4",
|
|
"version-string": "4.4.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|