mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-29 03:29:01 +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": "0d92e5b33e3b57bed654510b0562ac82c68019cf",
|
|
"version-string": "2020-06-02",
|
|
"port-version": 3
|
|
},
|
|
{
|
|
"git-tree": "edf9c537c7b19a49a2aac339e4cd4a96d6d0c774",
|
|
"version-string": "2020-06-02",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "a1b88394762d856840fe8a13fc8274e488303c25",
|
|
"version-string": "2020-06-02-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4e6755ea137719b61bca9d806002dcafae5ae084",
|
|
"version-string": "2020-06-02",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "30a395bb2eccb693a50d31f5779cad9ce396c665",
|
|
"version-string": "3.2-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9e67b0d7bcdfece838a0eac89848a7dfb2d66303",
|
|
"version-string": "3.2-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "27e1838ee3246851ec684abdbe60a582ed582c79",
|
|
"version-string": "3.2-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c50ef83138dac8f509d44f80102ba57f784f4226",
|
|
"version-string": "3.2",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|