File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -186,9 +186,21 @@ def fix_install_names
186186 return if bad_names . empty?
187187
188188 def fix_tea_prefix s
189- s = Pathname . new ( s ) . relative_path_from ( Pathname . new ( $tea_prefix) )
189+ s = Pathname . new ( s )
190+ s = s . realpath if s . symlink?
191+
192+ shortest = nil
193+ s . parent . each_child do |file |
194+ file = s . dirname . join ( file )
195+ if file . symlink? and file . realpath == s and ( shortest . nil? or file . basename . to_s . length < shortest . basename . to_s . length )
196+ shortest = file
197+ end
198+ end
199+
200+ s = shortest if shortest # if not then just try anyway
201+
202+ s = s . relative_path_from ( Pathname . new ( $tea_prefix) )
190203 s = s . sub ( %r{/v(\d +)\. (\d +\. )+\d +[a-z]?/} , '/v\1/' )
191- s = s . sub ( %r{[-.]\d +(\. \d +)*\. dylib$} , '.dylib' )
192204
193205 abort "#{ s } doesn’t exist!" unless File . exist? ( File . join ( $tea_prefix, s ) )
194206
You can’t perform that action at this time.
0 commit comments