mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-11 06:29:25 +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 ```
55 lines
1.3 KiB
JSON
55 lines
1.3 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "27503732c21f2d6652d12d62b1e9c180c1d33c47",
|
|
"version-string": "0.4.0",
|
|
"port-version": 4
|
|
},
|
|
{
|
|
"git-tree": "ec7f01875b20c7145088d5ec7a1927a5faea5ca6",
|
|
"version-string": "0.4.0-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1259c0962eb1027fdb884f5ddca131f37d182ada",
|
|
"version-string": "0.4.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3e42b59038804aeccbb8572a7f39f4b93f171b29",
|
|
"version-string": "0.4.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ce92e93c37ae6faf8ff82f5ef14a66b8977ed5e7",
|
|
"version-string": "0.4.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8baba65e1ef246885a8366c863e1c3a7185effd1",
|
|
"version-string": "0.3.5-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4323414e8ab13cd3dab50c3c03a5fe3e9af38352",
|
|
"version-string": "0.3.5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "bf209ae19c87850aaad51929fa9dbac4df10058a",
|
|
"version-string": "0.3.4-0472b91-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3b64e82075666999b8d477c3b49ee955aa1b21c6",
|
|
"version-string": "0.3.4-0472b91",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9ae61ae2b5e7a2829072ded07af8202568e2afd1",
|
|
"version-string": "0472b91",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|