mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-29 20:23:41 +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 ```
80 lines
2.0 KiB
JSON
80 lines
2.0 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "8b1c139f382edc4b0e9e1e3ba7ecd25667583f36",
|
|
"version-string": "2.0.5",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "d0a9eecd26e5ba37e9827e8cfdbb85700c313f80",
|
|
"version-string": "2.0.5",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "09228a708e3a67fd6dc9050b9fc9ac54408b2e3e",
|
|
"version-string": "2.0.5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "691b1216805e5c5d3fd16e1069da9956db376666",
|
|
"version-string": "2.0.4-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "7c762662e9982da95ab41ee1e0f0b793f125e0ef",
|
|
"version-string": "2.0.4-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b6ff67887d105f44936a1629387eca169cb6d45d",
|
|
"version-string": "2.0.4-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "80c484e65a78d17e7704c0adf5e760e23fa8d69c",
|
|
"version-string": "2.0.4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d41dc5de578f53e7a35a06b2964dfc50514db03e",
|
|
"version-string": "2.0.2-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a15f1003998c90155f1723f878897237a1d308ad",
|
|
"version-string": "2.0.2-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "aeb79a4eb6268ad638f8a8a46632d7cc6b7b4709",
|
|
"version-string": "2.0.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "afb28a3a8882a012dd647e7cbe86f940c31489b3",
|
|
"version-string": "2.0.1-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "82335433d4231ef7bf6ba7bb3823c652fa27baff",
|
|
"version-string": "2.0.1-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2b9399753701f7c8d648de00fb73dc8cce2f6ee5",
|
|
"version-string": "2.0.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "edb5da7ef12fc6c18bde71930a61f61a0dc7d7cd",
|
|
"version-string": "2.0.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "173e4fa5a794171877b6a2609e28d9e6bee8f11d",
|
|
"version-string": "",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|