mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-29 03:19:01 +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 ```
95 lines
2.4 KiB
JSON
95 lines
2.4 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "afde1764bdbdc03cc32ffcb580bb587faa36b0c5",
|
|
"version-string": "3.4.0-5",
|
|
"port-version": 3
|
|
},
|
|
{
|
|
"git-tree": "d0b0f339d4533201003aefd28a57efc827414434",
|
|
"version-string": "3.4.0-5",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "604e80750b83ac609caa6acca73b09307900a9cd",
|
|
"version-string": "3.4.0-5",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "e97bc71bb124f63fc4542039df254f4811322001",
|
|
"version-string": "3.4.0-5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9af9e5be2065850e4010aba38438db43ecec8cbf",
|
|
"version-string": "3.4.0-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d287ae96f1d2c41500bceceaded6927f708d54c2",
|
|
"version-string": "3.4.0-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "5a6bd362d6e20ba973b7f9d3e30e59907e3f7b2c",
|
|
"version-string": "3.4.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "5b1855cfe3d2cff3abf3b87bd3cfcde7fff7419e",
|
|
"version-string": "3.4.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c06b5d3a86074a5316faab2a8de0f836d66ec5b9",
|
|
"version-string": "3.2.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f47a79fea0c3762e56741101863982b763c9817f",
|
|
"version-string": "3.2.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d706dc22b38b3c140dae5a61f95a5e5df298fd5d",
|
|
"version-string": "3.1.1-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "7add01cf7622cda4b63e6d83a1da4997282778a9",
|
|
"version-string": "3.1.1-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "fd7d11526f6473efc9c14e8714113539af54cd4b",
|
|
"version-string": "3.1.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d2d3ebed65e3e7e244fbc295422284db10e1a0f0",
|
|
"version-string": "3.1.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a516ad2ba1ff48252f2c319c7e65341107f51d2f",
|
|
"version-string": "3.0.3-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9fbd68d8f2d7235cf74d7b44c1730239da6557fe",
|
|
"version-string": "3.0.3-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "510cbd1e1a837a6e42256039e42f21655110ef8c",
|
|
"version-string": "3.0.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2e1310c3ecb2b8fc0b8c5e79aafb840876f8f45f",
|
|
"version-string": "3.0.2",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|