mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-29 00:29:00 +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.3 KiB
JSON
55 lines
1.3 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "e0dd535be8f9f4f477cc21a745724b2c42f93d01",
|
|
"version-string": "3.3.11.1",
|
|
"port-version": 9
|
|
},
|
|
{
|
|
"git-tree": "7eb5deb666796bf91d2429c28325aa738b9e8941",
|
|
"version-string": "3.3.11.1-8",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "caef9c52f9cfd46ced189519b893a8e1ddbbfa60",
|
|
"version-string": "3.3.11.1-6",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "dc172c9f36270cc3ac3044b13c5347ade4161a41",
|
|
"version-string": "3.3.11.1-5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "4b1f8bafd9ba033af7ed8b21792e5896e23506d6",
|
|
"version-string": "3.3.11.1-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "65abc8f67c4b5e9332dfe42b4d06917a8ce454e0",
|
|
"version-string": "3.3.11.1-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "c1469a0214fe5fc350b64b8e76a58d901e42eef8",
|
|
"version-string": "3.3.11.1-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "afb47de2cf016bfd0ee2908f215a347c42700295",
|
|
"version-string": "3.3.11.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "899114150e1e27cac798735ded8b64fde8091f0b",
|
|
"version-string": "3.3.11.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "13faef585a51d40b3ee8c4b93b5184580acc42ce",
|
|
"version-string": "",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|