mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-10 07:19: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 ```
40 lines
1.0 KiB
JSON
40 lines
1.0 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "dd64f0dab429a6baf6dbb12119909ebd9caaa43a",
|
|
"version-string": "2019-04-19",
|
|
"port-version": 3
|
|
},
|
|
{
|
|
"git-tree": "803c42d38d110be4bdde22843088fca604e1879e",
|
|
"version-string": "2019-04-19-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f7e9fc59ddbad9443851f833a4adc15e35759514",
|
|
"version-string": "2019-04-19-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "11619659a6fa2607cdf4740ce9244400887ec731",
|
|
"version-string": "2019-04-19",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3514e7f730af6b116fd9c36e5574f5c40a3975e6",
|
|
"version-string": "2018-07-03",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8805d0261fb08fd4a8c1bc6c54ba968dbf73bc56",
|
|
"version-string": "20180131-89ede3ba90c906a8ec6b9a0f4bef188ba5bb2fd8-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "3b82020d1919842abf4d057c09f49e0d20650b7f",
|
|
"version-string": "20180131-89ede3ba90c906a8ec6b9a0f4bef188ba5bb2fd8-1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|