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 <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2020-06-05 03:36:59 -07:00
parent 7c0c53a332
commit d8da93897a
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 3 additions and 5 deletions

View File

@ -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