From 31ca9db73c872b39215097b1b4a2fe609ca1fc30 Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Sun, 26 May 2024 22:16:27 +0200 Subject: [PATCH] (#55) Test: fix ldd-apple output parsing --- macos/Test-Dependencies.ps1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/macos/Test-Dependencies.ps1 b/macos/Test-Dependencies.ps1 index 7b54ab8..fcc0502 100644 --- a/macos/Test-Dependencies.ps1 +++ b/macos/Test-Dependencies.ps1 @@ -32,13 +32,16 @@ Get-ChildItem "$Package/*.dylib" | Sort-Object -Property Name | ForEach-Object { Write-Output "Output from ldd-apple $($libraryPath):" Write-Output $output - $libraryNames = $output | Where-Object { ([string]$_).Contains('dyld: loaded') } | ForEach-Object { - if (!($_ -match 'dyld: loaded: <.*?> (.*)')) { + $libraryNames = $output | Where-Object { + [string]$line = $_ + $line.StartsWith('dyld[') -or $line.StartsWith('dyld: loaded:') + } | ForEach-Object { + if (!($_ -match 'dyld(?:: loaded|\[\d+\]): <.*?> (.*)')) { throw "Failed to parse ldd-apple output: $_" } $filePath = $Matches[1] - if ($filePath -ne $libraryPath) { + if ($filePath -ne $libraryPath -and !$filePath.Contains('cpp.exec')) { $filePath } } | Sort-Object