mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 06:51:48 +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 ```
85 lines
2.1 KiB
JSON
85 lines
2.1 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "7a309365a3b06309b47543f15b421ecfe4421d6a",
|
|
"version-string": "1.7.0",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "d436f6df2863c1bf133c1f0efd53cb8281710b80",
|
|
"version-string": "1.7.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6cdfbfb527ed75e097d74d502fe2dcaea147d5f0",
|
|
"version-string": "1.5.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "aab0369fb81b969656cdb4a925ce539d71ca46c6",
|
|
"version-string": "1.4.4-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "60cfc10dad4e9603fa9e75bb62eb9ab3ebaadc19",
|
|
"version-string": "1.2.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f3491a7035a4fd02f48b0458a50bc784031527b6",
|
|
"version-string": "1.2.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "549a9c194034604a2585f9e7a9c8385739f09710",
|
|
"version-string": "1.1.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4938dcc9d95d7c148d74b7c3a6f2d4cf6ace74d4",
|
|
"version-string": "1.1.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "207c65df83c090a3c525a051a7aeecb91b3e2c0f",
|
|
"version-string": "2019-06-13",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "804b6ebdddce2556f5b384749f155dda0a2ef500",
|
|
"version-string": "2019-05-27",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "04ec354f88aa3e0a00b0a0ee4ce60f7dc63cc310",
|
|
"version-string": "2019-05-07-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3c34c160ac6049cee2772086d24399122843d9fa",
|
|
"version-string": "2019-05-07-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a4ac6d8f4fc9135eb4ad4ee0506d4db9b7c87c0a",
|
|
"version-string": "2019-05-07",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "497f5acdcd83a0c6d5cde89348fa8a3f8d2bea4b",
|
|
"version-string": "2019-04-30",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3a7fd8de68722a1780db665ba2c7213b616d187b",
|
|
"version-string": "2019-04-16",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e86c8415085f9cd61fde2f798716650b4e3da85e",
|
|
"version-string": "v1.0.0-1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|