mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-10 01:39: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 ```
40 lines
956 B
JSON
40 lines
956 B
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "a6113e1a5fcadb00943ea3775b6978950b387903",
|
|
"version-string": "3.2.19",
|
|
"port-version": 5
|
|
},
|
|
{
|
|
"git-tree": "80b636f7c2459aaebfdaeade4f9f0c3892e785dd",
|
|
"version-string": "3.2.19-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "742cbabc36815039e7824e4d4517ac9ad5bc3aa0",
|
|
"version-string": "3.2.19-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "379b56c46cd2139b66c84c8bc67edf5bc3362a34",
|
|
"version-string": "3.2.19-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "add04fedcda8d675524d3ecc4b1900ad19ad66d5",
|
|
"version-string": "3.2.19-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c0bc902c6bf35178030984307f7b0cd7b45604ec",
|
|
"version-string": "3.2.19",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3bbf8f6e51b061b7023c5dc9d88862b9f5c2928b",
|
|
"version-string": "",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|