diff options
Diffstat (limited to 'Library/Homebrew/bottles.rb')
| -rw-r--r-- | Library/Homebrew/bottles.rb | 18 | 
1 files changed, 13 insertions, 5 deletions
diff --git a/Library/Homebrew/bottles.rb b/Library/Homebrew/bottles.rb index c1d6225df..e49872f75 100644 --- a/Library/Homebrew/bottles.rb +++ b/Library/Homebrew/bottles.rb @@ -38,11 +38,19 @@ def bottle_tag    end  end -def bottle_filename_formula_name filename -  path = Pathname.new filename -  version = BottleVersion.parse(path).to_s -  basename = path.basename.to_s -  basename.rpartition("-#{version}").first +def bottle_resolve_formula_names bottle_file +  receipt_file_path = Utils.popen_read("tar", "-tzf", bottle_file, "*/*/INSTALL_RECEIPT.json").chomp +  receipt_file = Utils.popen_read("tar", "-xOzf", bottle_file, receipt_file_path) +  name = receipt_file_path.split("/").first +  tap = Tab.from_file_content(receipt_file, "#{bottle_file}/#{receipt_file_path}").tap + +  if tap.nil? || tap == "Homebrew/homebrew" || tap == "mxcl/master" +    full_name = name +  else +    full_name = "#{tap.sub("homebrew-", "")}/#{name}" +  end + +  [name, full_name]  end  class Bintray  | 
