new method bottle_resolve_formula_names

Also remove bottle_filename_formula_name
This commit is contained in:
Xu Cheng 2015-05-27 22:47:19 +08:00
parent 129f780bba
commit 557ddcac36

View File

@ -38,11 +38,19 @@ def bottle_tag
end end
end end
def bottle_filename_formula_name filename def bottle_resolve_formula_names bottle_file
path = Pathname.new filename receipt_file_path = Utils.popen_read("tar", "-tzf", bottle_file, "*/*/INSTALL_RECEIPT.json").chomp
version = BottleVersion.parse(path).to_s receipt_file = Utils.popen_read("tar", "-xOzf", bottle_file, receipt_file_path)
basename = path.basename.to_s name = receipt_file_path.split("/").first
basename.rpartition("-#{version}").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 end
class Bintray class Bintray