mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-29 20:23:41 +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.5 KiB
JSON
60 lines
1.5 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "e290ae7965dd6b7d333df5aa3a9a56df1bd8e24c",
|
|
"version-string": "2020-09-14",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "510adf88620e2f9d059d5fad33826148cd157957",
|
|
"version-string": "2020-09-14",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "70864cb04a4c9b3e006b61174572fd73d9636b2f",
|
|
"version-string": "2019-03-29",
|
|
"port-version": 4
|
|
},
|
|
{
|
|
"git-tree": "bc1822817ca08f645cff5f3fa7004b7f2c87c4d1",
|
|
"version-string": "2019-03-29-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4221297464606010bc9f77daf5ae8be4b2f1c523",
|
|
"version-string": "2019-03-29-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e52376d6a52e61c69680b317a5f3fd3f15f63829",
|
|
"version-string": "2019-03-29-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "aa481e047172bc4aaf23658fdc2aa26d108daf52",
|
|
"version-string": "2019-03-29",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "704b2c66ea56709f33dfb22703a4927e8af4a922",
|
|
"version-string": "2018-09-18",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "73845f2ec15e48b73d4fbf3c0d0f0934d4582c76",
|
|
"version-string": "2018-02-25",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c8a43eaf03ce3a6bec67d700359b7d42e67ff4d6",
|
|
"version-string": "2017-10-9-82fb152a74f01b1483ac80d15935fbdfaf3ed836",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a94520898aa0e54b08562e0ece07d312cc302b95",
|
|
"version-string": "",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|