mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-29 04: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 ```
65 lines
1.6 KiB
JSON
65 lines
1.6 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "9b4af767d959bb37711e474327acba689127749c",
|
|
"version-string": "2021-05-09",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "a7b98cc69b89dfd9f776ef1b95f26d784fd3b82b",
|
|
"version-string": "2021-05-09",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ed53517a6b3c746ae38fa66fc3f53e4a0995a3c7",
|
|
"version-string": "2021-01-08",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b5584f0169f2455b61d60f8fd53c0d4e0fa2732f",
|
|
"version-string": "2020-09-22",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "5570afa11a3c704891576874a8f3c5b2f1420682",
|
|
"version-string": "2020-08-29",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "582062382c942f52c716b612b62d045300ed8d60",
|
|
"version-string": "2020-08-04",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "ea0293814778b470678a53fe04aa953bffa7e16e",
|
|
"version-string": "2020-07-01",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "cb20be3ef49ae4e063a9303cc14f500c165a1b08",
|
|
"version-string": "2020-06-02",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "fdc326330ba975c2114378381187bf180e359566",
|
|
"version-string": "2020-05-25",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e747dc136e590035c296c2c9d20e28e6d34de4dd",
|
|
"version-string": "2020-02-17",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "02a89afa85894c3f8bcf50600367748fe277f859",
|
|
"version-string": "2020-02-03",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a574ec9d108a30941e2f4c1cb90a3899c6a9d540",
|
|
"version-string": "2019-10-24",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|