From 2e77de3b58043cb8acc1e28070ae7e24fbf596fb Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Mon, 25 Sep 2017 22:46:51 -0700 Subject: Fix installing a local bottle from source Factor Utils::Bottles.formula_contents out of BottleLoader. --- Library/Homebrew/utils/bottles.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Library/Homebrew/utils') 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 -- cgit v1.2.3