mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-01 18:39: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 ```
55 lines
1.3 KiB
JSON
55 lines
1.3 KiB
JSON
{
|
|
"versions": [
|
|
{
|
|
"git-tree": "cf1a0e97d00a5748dc58db7d0a5da0fd7d5efb66",
|
|
"version-string": "1.6.1",
|
|
"port-version": 4
|
|
},
|
|
{
|
|
"git-tree": "6f367c81a074fd156d7f054bcacbdae0b01a5f5c",
|
|
"version-string": "1.6.1",
|
|
"port-version": 3
|
|
},
|
|
{
|
|
"git-tree": "9178b7e078f0093aa2cc4b42cd22e9bbc5537f6c",
|
|
"version-string": "1.6.1",
|
|
"port-version": 2
|
|
},
|
|
{
|
|
"git-tree": "450b0cdebafbdebc56b926d372307d1b86f6b9f9",
|
|
"version-string": "1.6.1-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a2f0bcf9b2f562d2cd6a033d4552a638e6b849bb",
|
|
"version-string": "1.6.1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "22f26a9e37de504ad54cc30e407d3f2644600b73",
|
|
"version-string": "1.6.0-5",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "96cf1cbcb872aaada516d15a77b607f93c812fa0",
|
|
"version-string": "1.6.0-3",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "5aad761bd51d83bf2d2ab9d0d4fbab5b59d96b9d",
|
|
"version-string": "1.6.0-2",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "426ca0a02ae6c9299754074d38f26ce31238fc32",
|
|
"version-string": "1.6.0-1",
|
|
"port-version": 0
|
|
},
|
|
{
|
|
"git-tree": "a595d02e90cecaf2795f639814030395f0fb126c",
|
|
"version-string": "1.6.0",
|
|
"port-version": 0
|
|
}
|
|
]
|
|
}
|