mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-18 22:27:50 +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 ```
75 lines
1.8 KiB
JSON
75 lines
1.8 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "eea4815ae315b38373961c8ff9a5be8556857b3f",
|
|
"version-string": "0",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "17c08b9a2f5c67b9ab0fb3d231bb6d67af26a208",
|
|
"version-string": "0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "96c1896f31f03bb3cbcc6dc929b3339fe0cf637b",
|
|
"version-string": "v84-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e1a868241c6382332cf8517844f6875102a3f934",
|
|
"version-string": "v84",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1009f20a8e7bb16325e7d417f328050fc43f467c",
|
|
"version-string": "v76",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c1788efff3acb96100ee071a1353265bc8a0d417",
|
|
"version-string": "v66",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f9b9a887ec00934c88032d5bdc71ed765a205073",
|
|
"version-string": "v63",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "da69804ed4cf00f6d4bc41da99c58d41491c54b1",
|
|
"version-string": "v59",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "29778f7db1809ab37ceba1984949601a1f4b616b",
|
|
"version-string": "v58",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "7719ad1d340f47cb354ddf1a5b1cc8b5a68e2222",
|
|
"version-string": "v56",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "9047b144fc312b5a38a90c1d88ef431c08bf0303",
|
|
"version-string": "v55",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c854069b8be8cd787a3c26d4a5a975df4556192f",
|
|
"version-string": "v54",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ff3e24da713abac7593360e51f6d79e17bd30631",
|
|
"version-string": "v40",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "dc897bb38d39c0c5126faf56107d79733fcaed1e",
|
|
"version-string": "1.0.0-b30",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|