aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim D. Smith2016-07-27 08:54:56 -0700
committerTim D. Smith2016-07-27 17:49:49 -0700
commit9c0a2ac933ba5de08ee751ed4eace49d607d9abb (patch)
tree8b7416df870b933d994fdd2983a0176b0483c808
parenta8cbcfa0809130922d274536469c23e60e712f20 (diff)
downloadbrew-9c0a2ac933ba5de08ee751ed4eace49d607d9abb.tar.bz2
Don't fail on arbitrary absolute symlinks
Still forbid absolute symlinks including prefix
-rw-r--r--Library/Homebrew/cmd/bottle.rb23
1 files changed, 7 insertions, 16 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb
index eed154384..f2cf36235 100644
--- a/Library/Homebrew/cmd/bottle.rb
+++ b/Library/Homebrew/cmd/bottle.rb
@@ -100,16 +100,11 @@ module Homebrew
def keg_contains_absolute_symlink_starting_with?(string, keg)
absolute_symlinks_start_with_string = []
- absolute_symlinks_rest = []
keg.find do |pn|
if pn.symlink? && (link = pn.readlink).absolute?
if link.to_s.start_with?(string)
absolute_symlinks_start_with_string << pn
- else
- absolute_symlinks_rest << pn
end
-
- result = true
end
end
@@ -120,16 +115,9 @@ module Homebrew
puts " #{pn} -> #{pn.resolved_path}"
end
end
-
- unless absolute_symlinks_rest.empty?
- opoo "Absolute symlink:"
- absolute_symlinks_rest.each do |pn|
- puts " #{pn} -> #{pn.resolved_path}"
- end
- end
end
- result
+ !absolute_symlinks_start_with_string.empty?
end
def bottle_output(bottle)
@@ -245,12 +233,15 @@ module Homebrew
ignores << %r{#{Regexp.escape(HOMEBREW_CELLAR)}/go/[\d\.]+/libexec}
end
+ relocatable = true
if ARGV.include? "--skip-relocation"
- relocatable = true
skip_relocation = true
else
- relocatable = !keg_contains(prefix_check, keg, ignores)
- relocatable = !keg_contains(cellar, keg, ignores) && relocatable
+ relocatable = false if keg_contains(prefix_check, keg, ignores)
+ relocatable = false if keg_contains(cellar, keg, ignores)
+ if prefix != prefix_check
+ relocatable = false if keg_contains_absolute_symlink_starting_with?(prefix, keg)
+ end
skip_relocation = relocatable && !keg.require_install_name_tool?
end
puts if !relocatable && ARGV.verbose?