21 lines
857 B
PowerShell
21 lines
857 B
PowerShell
param(
|
|
[Parameter(Mandatory)][string]$SeriesPath,
|
|
[Parameter(Mandatory)][ValidatePattern('^[0-9a-f]{40}$')][string]$RuntimeCommit
|
|
)
|
|
|
|
$targets = @('reims-vgpu', 'vendor/qemu', 'reims-util', 'metal2vulkan')
|
|
foreach ($line in Get-Content -LiteralPath $SeriesPath) {
|
|
$text = $line.Trim()
|
|
if (!$text -or $text.StartsWith('#')) { continue }
|
|
$parts = $text -split '\s+'
|
|
if ($parts.Count -notin @(2, 3) -or $parts[0] -notin $targets -or
|
|
($parts.Count -eq 3 -and $parts[2] -cnotmatch '^[0-9a-f]{40}$')) {
|
|
throw "Bad line in patches/series.txt: '$line'"
|
|
}
|
|
if ($parts.Count -eq 3 -and $parts[2] -cne $RuntimeCommit) {
|
|
Write-Host "skipped $($parts[0]) $($parts[1]) (requires runtime $($parts[2]), building $RuntimeCommit)"
|
|
continue
|
|
}
|
|
[pscustomobject]@{ Target = $parts[0]; Name = $parts[1] }
|
|
}
|