From c4363e8c585be1a8bb26eb1d2070fa4752beee08 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Wed, 19 Dec 2018 20:12:28 -0500 Subject: [PATCH] mac/keg_relocate: Remove short-circuit, cleanup --- Library/Homebrew/extend/os/mac/keg_relocate.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb index a68b7690fd..effb372b89 100644 --- a/Library/Homebrew/extend/os/mac/keg_relocate.rb +++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb @@ -78,14 +78,11 @@ class Keg def expand_rpath(file, bad_name) suffix = bad_name.sub(/^@rpath/, "") - # short circuit: we expect lib to be usually correct, so we try it first - return (lib / suffix) if (lib / suffix).exist? - file.rpaths.each do |rpath| - return (rpath / suffix) if (rpath / suffix).exist? + return (rpath/suffix) if (rpath/suffix).exist? end - opoo "Could not expand an RPATH in #{file}" + opoo "Could not find library #{bad_name} for #{file}" bad_name end