mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 18:31:15 +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 ```
45 lines
1.1 KiB
JSON
45 lines
1.1 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "da525f4c21c19e8eb2d81d6f352467395b55f354",
|
|
"version-string": "0.4.56",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "18178de87240278976fc659b52d8a86dbda31329",
|
|
"version-string": "0.4.56",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "3b58ff9b212a0910118c979470d7e53925d1b705",
|
|
"version-string": "0.4.56",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "de827b03e2db3b173e5d6d25266e6489608c119d",
|
|
"version-string": "0.4.15",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0d766b6dc8e60e4d7a4c3a6eb7e15fba323fdff6",
|
|
"version-string": "0.4.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f70c131558d24973206d24f40356a30346617c1e",
|
|
"version-string": "0.3.11-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "68789bb84f4ad94e006386403e46970c280d6d46",
|
|
"version-string": "0.3.11",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f60a72a5b4fb56cc3f952fb8acf1800776b56eda",
|
|
"version-string": "0.3.0",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|