mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-08 11:11: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 ```
45 lines
1.0 KiB
JSON
45 lines
1.0 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "f1fb2965625f4dc28c5ab3c4e0a8a128901a0f0e",
|
|
"version-string": "4.3",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "118bde1435b5cc73170ebaa8f17a93b6ea963bcd",
|
|
"version-string": "4.3-0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "078519b458b2adb4c722a4be78e28f527d6f05c0",
|
|
"version-string": "4.2-1-0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "10ea1353e81f7a30e996dd52df994c63ca41ad51",
|
|
"version-string": "4.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1dd59ddb7e6b80f13d3b7b3f860ad87ff4fca7ac",
|
|
"version-string": "4.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d1075504f6fe43fefaaf86dc7d75e65d061e968e",
|
|
"version-string": "4.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "aaecbeb42db4d856fe568749028684b61e6dcf9c",
|
|
"version-string": "4.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d43e8b84a909816c32a1ce720c80a9d2e34e1e50",
|
|
"version-string": "4.0",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|