mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-18 17:07:54 +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": "ae8921f17a82f01e5e68e494c8fe1823085eb496",
|
|
"version-string": "2010.04.30",
|
|
"port-version": 7
|
|
},
|
|
{
|
|
"git-tree": "00e038eff99864c2c73a807f0641c17e364547b0",
|
|
"version-string": "2010.04.30",
|
|
"port-version": 6
|
|
},
|
|
{
|
|
"git-tree": "3d92889fb018b73f520bde1a623db283838f5a7d",
|
|
"version-string": "2010.04.30",
|
|
"port-version": 5
|
|
},
|
|
{
|
|
"git-tree": "ece18a8ff1b53330cbde718bc977d16e83b3f752",
|
|
"version-string": "2010.04.30-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b65e19d6308e31ce43180f125f08fb5d357c3de0",
|
|
"version-string": "2010.04.30-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "942ddfd589666b15e4113df6438078cd7a3931c2",
|
|
"version-string": "2010.04.30-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "687c95e2d8c5e4dd9df75df005c8920c788b4834",
|
|
"version-string": "2010.04.30-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f051f0cf6a477a97b412bef03d3e80341149c7e0",
|
|
"version-string": "2010.04.30",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|