bottles: new method bottle_receipt_path

Thanks @sjackman's advice
This commit is contained in:
Xu Cheng 2015-06-06 14:02:30 +08:00
parent 31ca2831f3
commit 97fff0cd50

View File

@ -38,8 +38,12 @@ def bottle_tag
end
end
def bottle_receipt_path bottle_file
Utils.popen_read("tar", "-tzf", bottle_file, "*/*/INSTALL_RECEIPT.json").chomp
end
def bottle_resolve_formula_names bottle_file
receipt_file_path = Utils.popen_read("tar", "-tzf", bottle_file, "*/*/INSTALL_RECEIPT.json").chomp
receipt_file_path = bottle_receipt_path bottle_file
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