mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 19:25:27 +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 ```
60 lines
1.4 KiB
JSON
60 lines
1.4 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "1d1994c5a5daa97ce12d638f9be750ce2b63b5ef",
|
|
"version-string": "alias",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "732e1808e521305fa8f5210395976b9ed06f6ee1",
|
|
"version-string": "alias",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "75c5474e5857491f13f6e57a53f997f5f49c1301",
|
|
"version-string": "0.9.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a16c63d07fdf56b97bf13f73455fbf4b6cb476bf",
|
|
"version-string": "0.8.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b8be6ae916d08dcd2dd1cd91cd62789e6553dd76",
|
|
"version-string": "0.7.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "376f06cdb6b6512e68c7c037a45e750a9f1743c4",
|
|
"version-string": "0.6.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9ed86edf4a6cc11f4a4afee4c63cfae37092ec61",
|
|
"version-string": "0.5.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "7632c519ca5c65e85670e46410dff41e210383ea",
|
|
"version-string": "0.4.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e355db0ea6570e3be0ef737f03c426e574ea50af",
|
|
"version-string": "0.1.5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "df850cd74ada9b2aa8253ca49461fbc258ec44c5",
|
|
"version-string": "0.1.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "daeed28ede1c2fce9fd9ae5cecace5234c2abc90",
|
|
"version-string": "0.1.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|