mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 05:52:04 +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": "466bc1dd28c6b14346669c6fae30752db269d08a",
|
|
"version-string": "1.0.0-beta1-9",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "a1cf11834f81f78f10ff18bcec0d7f1c42309f62",
|
|
"version-string": "1.0.0-beta1-9",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "134ed01f4047d9dcb077f5f0bf06d07b374fe7b1",
|
|
"version-string": "1.0.0-beta1-8",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "5523151914bd255b4f7be195cbf2c9c29ef9a202",
|
|
"version-string": "1.0.0-beta1-7",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d52c9b80ed5f478a1e9a1937ec5f80f2d9185da0",
|
|
"version-string": "1.0.0-beta1-6",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "8b2ff00922990bda0b92c1f75b47647070d7244e",
|
|
"version-string": "1.0.0-beta1-5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "55b8af0164609db8a0d3bed45af8673d0395b800",
|
|
"version-string": "1.0.0-beta1-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "85cf956236c59b0edb2116a898f8ba719404be17",
|
|
"version-string": "1.0.0-beta1-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "0df276aa0e11332e37369b97f897c3802ca82037",
|
|
"version-string": "1.0.0-beta1-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "1b1e1f65de977aa3f5c06d8244c3686a73c26602",
|
|
"version-string": "1.0.0-beta1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "021d82e87e6a17746f4be98a2088543c7bb20df8",
|
|
"version-string": "1.0.0-beta1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|