mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-06 07:19:02 +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 ```
40 lines
1020 B
JSON
40 lines
1020 B
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "660959f50cba9f2fa2bc5d9cf775e268d746c7e9",
|
|
"version-string": "2019-05-08",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "b0a1f3b7adf27f8437a4d6af30ec5367a225341d",
|
|
"version-string": "2019-05-08-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3c33456e75584e5c4a1e8cacaf0dd398e545ce13",
|
|
"version-string": "2019-05-08",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "38f189c21d0d0c0121254a51bc3453446c2e9215",
|
|
"version-string": "2018-02-25-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a799a90e828b4a20c584dee68c20b9c0322ad467",
|
|
"version-string": "2018-02-25",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4d12f7ea4aeb8d0042692c41698d68283d2cfc6d",
|
|
"version-string": "2017-09-02-8c60a2aefa19adb-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d2c79b617b16c4c4bb8773dd73f2dd266004a28b",
|
|
"version-string": "2017-09-02-8c60a2aefa19adb",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|