mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-01 17:09: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 ```
40 lines
957 B
JSON
40 lines
957 B
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "4af49c54047fc9b315b888d5f51aef8748aba132",
|
|
"version-string": "2.4.3",
|
|
"port-version": 7
|
|
},
|
|
{
|
|
"git-tree": "73c110a8763070c78749ce041eea862716bba72a",
|
|
"version-string": "2.4.3-6",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3e59024e040721ab61c27d837f78e9a5119a92d8",
|
|
"version-string": "2.4.3-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "fd2ee1a2603d27429390cc86df76336f911af7ab",
|
|
"version-string": "2.4.3-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "63db933f885df3e5c7fb98008f2820162ed85023",
|
|
"version-string": "2.4.3-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "36e575a97241ad0dc3cdf3c9d2f08d1a67826238",
|
|
"version-string": "2.4.3-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "cc5ee5da5e89b23de1d12406743b9cdef1820395",
|
|
"version-string": "2.4.3",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|