mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-29 03:34:26 +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.3 KiB
JSON
55 lines
1.3 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "c9149e9c9d7a08455647bcadb1f178b7ee6ff3d2",
|
|
"version-string": "1.7.3",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "0ef471f5497ea4d07f8282487141bcbe3ea9f319",
|
|
"version-string": "1.7.3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "079c1b8cc62fe544a3277a949422bd68c57e0c45",
|
|
"version-string": "1.7.2",
|
|
"port-version": 4
|
|
},
|
|
{
|
|
"git-tree": "c82b5fbc0a37ebd11ecb4f87b9d63df2552805e7",
|
|
"version-string": "1.7.2",
|
|
"port-version": 3
|
|
},
|
|
{
|
|
"git-tree": "02e991af7253bd4ef78d90fc43680c98be8bc817",
|
|
"version-string": "1.7.2-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "64a4c898a9b495de1c17c09768191f8cd47d5fd2",
|
|
"version-string": "1.7.2-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f5c982944db4d83e865aa8d4824e741b7391cf12",
|
|
"version-string": "1.7.2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "cfd89787a4b1b023d7cc87868ef11c8f8392b502",
|
|
"version-string": "1.7.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b4acdcd40d02cd596261e22dc851cb91e2667eac",
|
|
"version-string": "1.6.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8740a09298c3e43a0bacc1037dfee67768915fe1",
|
|
"version-string": "1.6.0",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|