mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-29 20:23:41 +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": "8b2b68ae08dffdf7b990d40a34b1ea53621aa856",
|
|
"version-string": "3.4.0",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "161afe071b88dc53bff7dd5b13909872ee370f92",
|
|
"version-string": "3.4.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "884bdeec3cee8a31ef3582bd02d7d5f74bb7350c",
|
|
"version-string": "3.3.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c91435c083272a10a6dde2b60f459b3935a27352",
|
|
"version-string": "3.3.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "43ca432511afc78b75a2e2f1cd6af4cfb3c4e03e",
|
|
"version-string": "3.3.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "404cac887c7f316b8611fdb02a711f13ae72ebaa",
|
|
"version-string": "3.2.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "064e1e21b008cd25b2109d2587c27aa2a975ea3b",
|
|
"version-string": "3.1.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "cdda8cfdba2b8ed6626145c9427da3ab62fa4b9c",
|
|
"version-string": "3.0.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "963a072ff188cc86de5b03e57dfe671ed20b6f37",
|
|
"version-string": "2.1.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "dd9d629d2964c2339f8f8d06557b64a6d9077344",
|
|
"version-string": "2.0.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|