mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-30 08:31:37 +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 ```
55 lines
1.4 KiB
JSON
55 lines
1.4 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "fe6538eb3c7260ca155c82808519426a280e42e5",
|
|
"version-string": "2021-08-03",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "cb04005b6c8503a0da843fc8f356748e0a0d3994",
|
|
"version-string": "2021-08-03",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1085a9ee690f6718715b28396f5250ad67d6f828",
|
|
"version-string": "2021-02-04",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "48d7b90ae1c7d5f223caad5330a293463f470860",
|
|
"version-string": "2020-05-19",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "c592af57ce68d842a099b9533eb6a0b8f4aeddbe",
|
|
"version-string": "2020-05-19",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "6fc902885dd7217f576fd9d15a4e719e2a362416",
|
|
"version-string": "2019-11-07",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "e327535dff44b80591354a3ca152b451f2fc1391",
|
|
"version-string": "2019-07-16",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "2d4beb5a5c638983e5ea15da718adab37c1e11f4",
|
|
"version-string": "2019-07-09",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "5b69bc45e3d32c13cbafdf88fc70e455fa847473",
|
|
"version-string": "2019-06-10",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "f11a4f76cd1ad0ace37036a8e9468a3ce061ce22",
|
|
"version-string": "2019-05-08",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|