mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 14:49:33 +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": "47269f38d27248c1e52fd21c3a296d032e02ac01",
|
|
"version-string": "2.0.0",
|
|
"port-version": 7
|
|
},
|
|
{
|
|
"git-tree": "c70fc01038afbb6850538b0a4789b91c83113a8d",
|
|
"version-string": "2.0.0-6",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b21b499471e77eb459e8f30d66851c708f80d299",
|
|
"version-string": "2.0.0-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1058dc04da4ed63879c85e43ee4c5ed91126c520",
|
|
"version-string": "2.0.0-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2f9fb4b6aec6439f9fa8059732a034ed3b518a1c",
|
|
"version-string": "2.0.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "33cf4799b0670ee9e26144ee253c1eaa7bffa095",
|
|
"version-string": "2.0.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "7678f3ece15a57a5a267ffd122199f9e6c0f0b87",
|
|
"version-string": "2.0.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "5160323b001496be8efa3b6ccc326f9e41de4101",
|
|
"version-string": "2.0.0.2",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|