From d8da93897a4f3b7a53ecafed4a52d978382703d6 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Fri, 5 Jun 2020 03:36:59 -0700 Subject: [PATCH] Minor improvements for mac dyld linker. Minor code improvements. Do not suppress output of sudo invocation, this may cause it hang on an invisible password prompt. - Fix #676. Signed-off-by: Rafael Kitover --- tools/osx/third_party_libs_tool | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/osx/third_party_libs_tool b/tools/osx/third_party_libs_tool index 3b7c3142..1e4614df 100755 --- a/tools/osx/third_party_libs_tool +++ b/tools/osx/third_party_libs_tool @@ -66,7 +66,7 @@ main() { frameworks="$app_bundle/Contents/Frameworks" - mkdir -p "$frameworks" 2>/dev/null + mkdir -p "$frameworks" scan_libs "$@" | fully_resolve_links | sort -u | \ while read lib; do @@ -147,8 +147,7 @@ lib_scan() { IFS=' ' for lib in $(otool -L "$bin" 2>/dev/null \ - | awk '/^([^ \t]|([ \t]*\/(System|usr\/lib)\/))/ { next } \ - { sub("^[ \t]*", ""); sub("[ \t]*\\(.*\\)[ \t]*$", ""); print }'); do + | sed -E '1d; s/^[[:space:]]*//; \,^(/System|/usr/lib),d; s/[[:space:]]+\([^()]+\)[[:space:]]*$//'); do [ "$lib" = "$bin" ] && continue @@ -297,8 +296,7 @@ install_name_tool() { if ! command install_name_tool "$@" >"$out_file" 2>&1; then if grep -Eq -i 'permission denied|bad file descriptor' "$out_file"; then - if ! command sudo install_name_tool "$@" >"$out_file" 2>&1; then - cat "$out_file" >&2 + if ! command sudo install_name_tool "$@"; then return 1 fi elif ! grep -Eq -i 'would duplicate path' "$out_file"; then