vcpkg/versions/n-/nmslib.json
Billy O'Neal b295670e4b
Bulk convert control files. (#19986)
```
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
```
2021-09-09 01:24:04 -07:00

45 lines
1.1 KiB
JSON

{
"versions": [
{
"git-tree": "cc690326d2976978fc71bb8c0e5a631e6cec0064",
"version-string": "2.0.6",
"port-version": 1
},
{
"git-tree": "8aa3ecb4ff8364680fe15c756eb2e8a0fecbc167",
"version-string": "2.0.6",
"port-version": 0
},
{
"git-tree": "d420566df44d8d163d5e132c1e0d02a3e80a4d39",
"version-string": "1.8.2",
"port-version": 0
},
{
"git-tree": "e049b7f165d81c0c19d3b619e5b72b5fc53c038b",
"version-string": "1.8.1",
"port-version": 0
},
{
"git-tree": "3edf7a906a30e46cf045241413ee3bd0b5c7c49a",
"version-string": "1.7.3.6-1",
"port-version": 0
},
{
"git-tree": "3a8ca5525f7123c0b7cda6735c84b2362f345944",
"version-string": "1.7.3.6",
"port-version": 0
},
{
"git-tree": "eaddae2d1fb5769ecb38e466f45af91af7bc70db",
"version-string": "1.7.2-1",
"port-version": 0
},
{
"git-tree": "3dd4919058fb48e17cdc4bfde133202fe892df70",
"version-string": "1.7.2",
"port-version": 0
}
]
}