mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-09 19:29: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 ```
45 lines
1.1 KiB
JSON
45 lines
1.1 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "73b076af7e5bb74d8531885c3172ccdea74bce80",
|
|
"version-string": "0.10.1",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "3a556c1feb836e7e35ec66c2c9879235827d45f7",
|
|
"version-string": "0.10.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0862786acc338358d7e97a79e4a3c9e68cced4c7",
|
|
"version-string": "0.10.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "234e76946663fe1435fee7e8ad834e79e674954e",
|
|
"version-string": "0.9.4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "18e61afbf20c1797608a21e10848bc2e23ca5086",
|
|
"version-string": "0.9.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9369fbcbb3eba95b1e781c952c996e6b4e56c149",
|
|
"version-string": "0.9.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "574f0a08bd13d076a6d73de171189cf6e58b98d8",
|
|
"version-string": "0.9.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "cb3b0392b1fb1ea0fd25747a8baf493805b82e81",
|
|
"version-string": "2019-07-13",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|