mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-06 00:29:02 +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": "cd3839d56ad4263ecc52a94440b22333ab1d7bfe",
|
|
"version-string": "1.16.8",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "35ae9e20bdad47bb81e72b6ec792b6d15f6fba93",
|
|
"version-string": "1.16.8",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8bb491d21d959c966d12a8a6068f8b8d21aa7bc6",
|
|
"version-string": "1.12.5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ce1dcf697426512f8e9c74eb574ae0505f5903f1",
|
|
"version-string": "1.10.30",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b13b9ebd273df9d97f453faf554d745ed561511e",
|
|
"version-string": "1.9.16",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3d099f986bb03d2a6fa635e8fc53389b8a2b90ed",
|
|
"version-string": "1.5.17",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f382a7947b88d348c40ce977e09774caeb17910b",
|
|
"version-string": "1.4.18",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3b738831157101e2165934dc028aa759f84c00a4",
|
|
"version-string": "1.1.3b",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a9acf84e30648c01b28cc87b2ebccead439f9f28",
|
|
"version-string": "1.0.16",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "272b89aacbdae7ec5d92bfeb17a70d9825e9db34",
|
|
"version-string": "1.0.15",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "51b36f3797bf027e9d56ba9167e3ad28a4a77214",
|
|
"version-string": "1.0.14",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a6f3214a4e92b284c359e5b428f016d90ecb30e2",
|
|
"version-string": "1.0.13",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f3ae4945d1b8b8b3d135410a84d4faa120963172",
|
|
"version-string": "1.0.12",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4aa4e746904db6077274cfc65a6f0c6fa65b0332",
|
|
"version-string": "1.0.9",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2f066e65122d4d27fbdbb5016da5efa82d654706",
|
|
"version-string": "1.0.5",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|