mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 13:31: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 ```
40 lines
950 B
JSON
40 lines
950 B
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "a15a1eeb7daa3d47d553ba0b14a151462377c41f",
|
|
"version-string": "0.23",
|
|
"port-version": 8
|
|
},
|
|
{
|
|
"git-tree": "51daf85e8709cd28fab9f5ec16d87de3351e4a62",
|
|
"version-string": "0.23-7",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6e805dc3d7bf6a4d81dc68aab02bc5e697127ee5",
|
|
"version-string": "0.23-5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "13d15881ddf641c2458e5354ac71af2234cb3b13",
|
|
"version-string": "0.23-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d0cee79f332a30a168b6cd147ba1b55d59c0d7ab",
|
|
"version-string": "0.23-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ea23da682b72624869e7ff8bcac37dcd72848102",
|
|
"version-string": "0.23-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e1840364282eb7b9ac20c45468d3b1a7189272e9",
|
|
"version-string": "0.23",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|