mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-18 15:27:50 +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 ```
55 lines
1.4 KiB
JSON
55 lines
1.4 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "6de81be7e06cac0652c8ffcc136ffdb889cb41f8",
|
|
"version-string": "2018-10-25",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "7640751d4d50df9abb088cd6de1b397694fd6478",
|
|
"version-string": "2018-10-25",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "7ce0972fcf1195fcc78e85347f0a8a305288fe5d",
|
|
"version-string": "2018-09-18",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "54c13f7ee646474c05e3411978ba113fc322bdc8",
|
|
"version-string": "2018-07-30",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0abe0d97368c4d70cb357be5d9132f6406b99ec2",
|
|
"version-string": "2018-03-13",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d84835f4a8edd50245c4ecaf06ff4d94dba4e756",
|
|
"version-string": "2018-03-07",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "17e1512471c9602c2fda04a13a2dec518badea9b",
|
|
"version-string": "2018-02-25-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b18098bb81ed7fa78d1e4666a9ee20f94ee0e414",
|
|
"version-string": "2018-02-25",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1ae1c19dfdceaf3c61345faa9e7310474e6a5d4f",
|
|
"version-string": "2017-10-09-dd906fed8c8aff8dc837657c42f9d55f8b793b0e",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "caa13d590bc77e01e7c9f3d04cc88f13e622dc92",
|
|
"version-string": "1.10.8",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|