mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-05 17:49:03 +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 ```
45 lines
1.1 KiB
JSON
45 lines
1.1 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "6cf85007fff76b915306c36ced6d3cf94c96e074",
|
|
"version-string": "replaced",
|
|
"port-version": 1
|
|
},
|
|
{
|
|
"git-tree": "38136f16ec4b0eacdb76d63a639fc20b8d6ef208",
|
|
"version-string": "replaced",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "198fcfc33e120b2311bff9c9a0292967839bca7d",
|
|
"version-string": "4.4",
|
|
"port-version": 5
|
|
},
|
|
{
|
|
"git-tree": "32dee82c177857fed77cea3a0508d2cdc9f4b4b7",
|
|
"version-string": "4.4-4",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "d64adcfbf28a702739f8c818f26d41aadff23474",
|
|
"version-string": "4.4-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "98a520bd1c220d3da7df03bb0c74ed3874cc422c",
|
|
"version-string": "4.4-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "b6f70fc496ca9b815c82d7d355016b4c9a046d2c",
|
|
"version-string": "4.4-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "274d1bf0c513d6b22fada7b662da512e7a05f580",
|
|
"version-string": "4.1",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|