mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-01 10:59:07 +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": "4923ceb767ecc4c6f5efb7bcc80fafef19718bd2",
|
|
"version-string": "2.4.0",
|
|
"port-version": 9
|
|
},
|
|
{
|
|
"git-tree": "d24a8283229f618903b2d446e7e22e4a0cf3f69f",
|
|
"version-string": "2.4.0",
|
|
"port-version": 8
|
|
},
|
|
{
|
|
"git-tree": "6c3f8c74462e65898e335eef5ab9fabc0a3b222f",
|
|
"version-string": "2.4.0",
|
|
"port-version": 7
|
|
},
|
|
{
|
|
"git-tree": "8d9cbc5ac098865e4e03b00f74c9c4de911a8534",
|
|
"version-string": "2.4.0-6",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "94aa42972fc7500b6b3b6cdbc557b80cd6c8e30f",
|
|
"version-string": "2.4.0-5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d29f7f97c703027e3011c5249be707e37f137802",
|
|
"version-string": "2.4.0-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "32b5eae3cbc5fd1087824bc9342ab124630659aa",
|
|
"version-string": "2.4.0-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f89b8cad9c1926728e690586289ef780e62752ac",
|
|
"version-string": "2.4.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "93fe00956c94f5774ba1be9667eee210d6c8bb7e",
|
|
"version-string": "2.4.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f285547c7717cc064b4f7cdecaccab4dc8b2ffe8",
|
|
"version-string": "2.4.0",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "7e021e1f3759535edd11ceae108328ecf38c0e67",
|
|
"version-string": "",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|