aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMike McQuaid2016-04-25 17:57:51 +0100
committerMike McQuaid2016-05-08 16:51:22 +0100
commit931e292bf12b8e05f6586ac7721255b35f04a389 (patch)
tree0ba3a1b81851de032c2e30a1f3fd3b2f6e3dc573 /Library/Homebrew/cmd
parentddb576b582ddc801ac702566bacbc2f231fc86af (diff)
downloadbrew-931e292bf12b8e05f6586ac7721255b35f04a389.tar.bz2
Make bottle code cross-platform.
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/bottle.rb8
-rw-r--r--Library/Homebrew/cmd/pull.rb5
-rw-r--r--Library/Homebrew/cmd/test-bot.rb8
3 files changed, 10 insertions, 11 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb
index 59e122f41..2f8f7f615 100644
--- a/Library/Homebrew/cmd/bottle.rb
+++ b/Library/Homebrew/cmd/bottle.rb
@@ -1,5 +1,5 @@
require "formula"
-require "bottles"
+require "utils/bottles"
require "tab"
require "keg"
require "formula_versions"
@@ -155,7 +155,7 @@ module Homebrew
return
end
- unless built_as_bottle? f
+ unless Utils::Bottles::built_as? f
return ofail "Formula not installed with '--build-bottle': #{f.full_name}"
end
@@ -175,7 +175,7 @@ module Homebrew
bottle_revision = bottle_revisions.any? ? bottle_revisions.max.to_i + 1 : 0
end
- filename = Bottle::Filename.create(f, bottle_tag, bottle_revision)
+ filename = Bottle::Filename.create(f, Utils::Bottles.tag, bottle_revision)
bottle_path = Pathname.pwd/filename
tar_filename = filename.to_s.sub(/.gz$/, "")
@@ -281,7 +281,7 @@ module Homebrew
bottle.prefix prefix
end
bottle.revision bottle_revision
- bottle.sha256 bottle_path.sha256 => bottle_tag
+ bottle.sha256 bottle_path.sha256 => Utils::Bottles.tag
old_spec = f.bottle_specification
if ARGV.include?("--keep-old") && !old_spec.checksums.empty?
diff --git a/Library/Homebrew/cmd/pull.rb b/Library/Homebrew/cmd/pull.rb
index 6f7136cf8..654461edb 100644
--- a/Library/Homebrew/cmd/pull.rb
+++ b/Library/Homebrew/cmd/pull.rb
@@ -32,7 +32,6 @@ require "utils/json"
require "formula"
require "formulary"
require "tap"
-require "bottles"
require "version"
require "pkg_version"
@@ -402,8 +401,8 @@ module Homebrew
# Publishes the current bottle files for a given formula to Bintray
def publish_bottle_file_on_bintray(f, creds)
- repo = Bintray.repository(f.tap)
- package = Bintray.package(f.name)
+ repo = Utils::Bottles::Bintray.repository(f.tap)
+ package = Utils::Bottles::Bintray.package(f.name)
info = FormulaInfoFromJson.lookup(f.name)
if info.nil?
raise "Failed publishing bottle: failed reading formula info for #{f.full_name}"
diff --git a/Library/Homebrew/cmd/test-bot.rb b/Library/Homebrew/cmd/test-bot.rb
index 13b5bd55c..a01467036 100644
--- a/Library/Homebrew/cmd/test-bot.rb
+++ b/Library/Homebrew/cmd/test-bot.rb
@@ -576,7 +576,7 @@ module Homebrew
bottle_step = steps.last
if bottle_step.passed? && bottle_step.has_output?
bottle_filename =
- bottle_step.output.gsub(/.*(\.\/\S+#{bottle_native_regex}).*/m, '\1')
+ bottle_step.output.gsub(/.*(\.\/\S+#{Utils::Bottles::native_regex}).*/m, '\1')
bottle_rb_filename = bottle_filename.gsub(/\.(\d+\.)?tar\.gz$/, ".rb")
bottle_merge_args = ["--merge", "--write", "--no-commit", bottle_rb_filename]
bottle_merge_args << "--keep-old" if ARGV.include? "--keep-old"
@@ -824,15 +824,15 @@ module Homebrew
remote = "git@github.com:BrewTestBot/homebrew-#{tap.repo}.git"
tag = pr ? "pr-#{pr}" : "testing-#{number}"
- bintray_repo = Bintray.repository(tap)
+ bintray_repo = Utils::Bottles::Bintray.repository(tap)
bintray_repo_url = "https://api.bintray.com/packages/homebrew/#{bintray_repo}"
formula_packaged = {}
Dir.glob("*.bottle*.tar.gz") do |filename|
- formula_name, canonical_formula_name = bottle_resolve_formula_names filename
+ formula_name, canonical_formula_name = Utils::Bottles.resolve_formula_names filename
formula = Formulary.factory canonical_formula_name
version = formula.pkg_version
- bintray_package = Bintray.package formula_name
+ bintray_package = Utils::Bottles::Bintray.package formula_name
if system "curl", "-I", "--silent", "--fail", "--output", "/dev/null",
"#{BottleSpecification::DEFAULT_DOMAIN}/#{bintray_repo}/#{filename}"