mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-15 07:49:01 +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 ```
50 lines
1.2 KiB
JSON
50 lines
1.2 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "53ad9cb3534a54fd11bd559932edb1b5c67cd8d0",
|
|
"version-string": "2.10",
|
|
"port-version": 7
|
|
},
|
|
{
|
|
"git-tree": "0386bfc83656abde700f2f99732a92e7fd6ac756",
|
|
"version-string": "2.10",
|
|
"port-version": 6
|
|
},
|
|
{
|
|
"git-tree": "7d19bc8d305faffeba8990d9e6c095ee95b3108d",
|
|
"version-string": "2.10-5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "18dd4e5315c0e0c8006cd9872700bf00ae77fb89",
|
|
"version-string": "2.10-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "98e1b10cdd1c281cfa9ba0ed00e975bdbab14e03",
|
|
"version-string": "2.10-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b9e9fe0c84428518c68d23fd52cd5cb03d66df81",
|
|
"version-string": "2.10-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3661a06c129607a43cb080621bd9c3752d5cafa2",
|
|
"version-string": "2.10-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b118721246bea85e78adfe2f9eea17c78d8aa23f",
|
|
"version-string": "2.10",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "25007a9018c1b82f8f6190513f2073cec1a4b545",
|
|
"version-string": "2.09",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|