firefox: fix flaky dylib check due to SIGPIPE race
The `otool ... | grep -q ...` pipeline sometimes fails with PIPESTATUS=141 because of SIGPIPE race. It happens because `grep -q` doesn't drain the pipe but exits on first match. If it exists before `otool` writes its last line to stdout, `otool` fails on write. It makes the whole dylib check fail. This results in a symlink left pointing to a dylib file instead of copying it, which may break the app. The solution is to drain the pipeline with `grep -F`.
This commit is contained in:
@@ -434,7 +434,7 @@ let
|
||||
;;
|
||||
*)
|
||||
# Copy if the symlink resolves to a Mach-O dylib
|
||||
otool -l "$file" 2>/dev/null | grep -q 'LC_ID_DYLIB' || continue
|
||||
otool -l "$file" 2>/dev/null | grep -F 'LC_ID_DYLIB' >/dev/null || continue
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
Reference in New Issue
Block a user