aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils
diff options
context:
space:
mode:
authorShaun Jackman2017-09-25 22:46:51 -0700
committerShaun Jackman2017-09-28 12:29:23 -0700
commit2e77de3b58043cb8acc1e28070ae7e24fbf596fb (patch)
treee11dfab3793eed2eb14852c529d8f80817dd27d5 /Library/Homebrew/utils
parent3ed832d4f0465aa9d938d3f4867ad12aaf394710 (diff)
downloadbrew-2e77de3b58043cb8acc1e28070ae7e24fbf596fb.tar.bz2
Fix installing a local bottle from source
Factor Utils::Bottles.formula_contents out of BottleLoader.
Diffstat (limited to 'Library/Homebrew/utils')
-rw-r--r--Library/Homebrew/utils/bottles.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/Library/Homebrew/utils/bottles.rb b/Library/Homebrew/utils/bottles.rb
index 73353496a..66b5fb640 100644
--- a/Library/Homebrew/utils/bottles.rb
+++ b/Library/Homebrew/utils/bottles.rb
@@ -54,6 +54,15 @@ module Utils
def resolve_version(bottle_file)
PkgVersion.parse receipt_path(bottle_file).split("/")[1]
end
+
+ def formula_contents(bottle_file,
+ name: resolve_formula_names(bottle_file)[0])
+ bottle_version = resolve_version bottle_file
+ formula_path = "#{name}/#{bottle_version}/.brew/#{name}.rb"
+ contents = Utils.popen_read "tar", "-xOzf", bottle_file, formula_path
+ raise BottleFormulaUnavailableError.new(bottle_file, formula_path) unless $CHILD_STATUS.success?
+ contents
+ end
end
class Bintray