mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-31 05:03:22 +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": "be577f000372e4ae6d9675bdb10ff25dce38d90d",
|
|
"version-string": "1.6",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "62e09e58648e190b5e5a6c2bd15da05dffad439b",
|
|
"version-string": "1.6",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "bd64b4ad149ed87a0605e2a5cacd490bc57ee959",
|
|
"version-string": "1.5",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "19a9253782d0a5d339d8b4f6ad3521ce0ba98efe",
|
|
"version-string": "1.5",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "3b2e209ef23a7f97469d9892228e7303ad6526f8",
|
|
"version-string": "1.5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c7f3bc361519b9ef0d9bd9d6b4c26856efec1e2a",
|
|
"version-string": "1.4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4d69881dfedcee477473fa98099247595d2123df",
|
|
"version-string": "1.3-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "defb5cf6e40fcbbae6781fce08834eaf1e31f38b",
|
|
"version-string": "1.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c0372ae1219186bcc7b8d2f018f35d1a07932173",
|
|
"version-string": "1.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "add3e0d6142238e191ecd5f9f1c0b514f68576ba",
|
|
"version-string": "1.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|