Skip to content
Snippets Groups Projects
Commit b4de801a authored by Markus Reiter's avatar Markus Reiter
Browse files

Support both `Homebrew` and `caskroom` for now.

parent c4c00e4e
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,8 @@ module Hbc
return if @cask.sourcefile_path.nil?
tap = @cask.tap
return if tap.nil? || tap.user != "caskroom"
return if tap.nil?
return unless ["Homebrew", "caskroom"].include?(tap.user)
return unless cask.artifacts.any? { |k| k.is_a?(Hbc::Artifact::Pkg) && k.stanza_options.key?(:allow_untrusted) }
add_warning "allow_untrusted is not permitted in official Homebrew-Cask taps"
......
......@@ -21,7 +21,7 @@ module Hbc
def self.search_remote(query)
matches = begin
GitHub.search_code(
user: "caskroom",
user: ["Homebrew", "caskroom"],
path: "Casks",
filename: query,
extension: "rb",
......
......@@ -3,7 +3,7 @@ module Hbc
@full_version ||= begin
<<~EOS
Homebrew-Cask #{HOMEBREW_VERSION}
caskroom/homebrew-cask #{Hbc.default_tap.version_string}
#{Hbc.default_tap.full_name} #{Hbc.default_tap.version_string}
EOS
end
end
......
......@@ -470,7 +470,7 @@ class Reporter
next unless tabs.first.tap == tap # skip if installed formula is not from this tap.
new_tap = Tap.fetch(new_tap_name)
# For formulae migrated to cask: Auto-install cask or provide install instructions.
if new_tap_name == "caskroom/cask"
if ["homebrew/cask", "caskroom/cask"].include?(new_tap_name)
if new_tap.installed? && (HOMEBREW_PREFIX/"Caskroom").directory?
ohai "#{name} has been moved to Homebrew-Cask."
ohai "brew unlink #{name}"
......
......@@ -101,7 +101,7 @@ module Homebrew
EOS
break if new_tap_name == CoreTap.instance.name
install_cmd = if new_tap_user == "caskroom"
install_cmd = if new_tap_user == "caskroom" || (new_tap_user == "homebrew" && new_tap_repo.start_with?("cask"))
"cask install"
else
"install"
......
......@@ -12,7 +12,7 @@ describe Hbc::CLI::Info, :cask do
local-caffeine: 1.2.3
http://example.com/local-caffeine
Not installed
From: https://github.com/caskroom/homebrew-spec/blob/master/Casks/local-caffeine.rb
From: https://github.com/Homebrew/homebrew-cask-spec/blob/master/Casks/local-caffeine.rb
==> Name
None
==> Artifacts
......@@ -26,7 +26,7 @@ describe Hbc::CLI::Info, :cask do
local-caffeine: 1.2.3
http://example.com/local-caffeine
Not installed
From: https://github.com/caskroom/homebrew-spec/blob/master/Casks/local-caffeine.rb
From: https://github.com/Homebrew/homebrew-cask-spec/blob/master/Casks/local-caffeine.rb
==> Name
None
==> Artifacts
......@@ -34,7 +34,7 @@ describe Hbc::CLI::Info, :cask do
local-transmission: 2.61
http://example.com/local-transmission
Not installed
From: https://github.com/caskroom/homebrew-spec/blob/master/Casks/local-transmission.rb
From: https://github.com/Homebrew/homebrew-cask-spec/blob/master/Casks/local-transmission.rb
==> Name
None
==> Artifacts
......@@ -56,7 +56,7 @@ describe Hbc::CLI::Info, :cask do
with-caveats: 1.2.3
http://example.com/local-caffeine
Not installed
From: https://github.com/caskroom/homebrew-spec/blob/master/Casks/with-caveats.rb
From: https://github.com/Homebrew/homebrew-cask-spec/blob/master/Casks/with-caveats.rb
==> Name
None
==> Artifacts
......@@ -82,7 +82,7 @@ describe Hbc::CLI::Info, :cask do
with-conditional-caveats: 1.2.3
http://example.com/local-caffeine
Not installed
From: https://github.com/caskroom/homebrew-spec/blob/master/Casks/with-conditional-caveats.rb
From: https://github.com/Homebrew/homebrew-cask-spec/blob/master/Casks/with-conditional-caveats.rb
==> Name
None
==> Artifacts
......@@ -97,7 +97,7 @@ describe Hbc::CLI::Info, :cask do
with-languages: 1.2.3
http://example.com/local-caffeine
Not installed
From: https://github.com/caskroom/homebrew-spec/blob/master/Casks/with-languages.rb
From: https://github.com/Homebrew/homebrew-cask-spec/blob/master/Casks/with-languages.rb
==> Name
None
==> Languages
......@@ -114,7 +114,7 @@ describe Hbc::CLI::Info, :cask do
without-languages: 1.2.3
http://example.com/local-caffeine
Not installed
From: https://github.com/caskroom/homebrew-spec/blob/master/Casks/without-languages.rb
From: https://github.com/Homebrew/homebrew-cask-spec/blob/master/Casks/without-languages.rb
==> Name
None
==> Artifacts
......
......@@ -89,7 +89,7 @@ describe Hbc::CLI::Style, :cask do
end
end
it { is_expected.to contain_exactly(a_path_ending_with("/caskroom/homebrew-spec/Casks"), a_path_ending_with("/third-party/homebrew-tap/Casks")) }
it { is_expected.to contain_exactly(a_path_ending_with("/homebrew/homebrew-cask-spec/Casks"), a_path_ending_with("/third-party/homebrew-tap/Casks")) }
end
context "when at least one cask token is a path that exists" do
......
......@@ -27,7 +27,7 @@ RSpec.shared_context "Homebrew-Cask" do
[Hbc::Config.global.binarydir, Hbc.caskroom, Hbc.cache].each(&:mkpath)
Hbc.default_tap = Tap.fetch("caskroom", "spec").tap do |tap|
Hbc.default_tap = Tap.fetch("Homebrew", "cask-spec").tap do |tap|
FileUtils.mkdir_p tap.path.dirname
FileUtils.ln_sf TEST_FIXTURE_DIR.join("cask"), tap.path
end
......@@ -42,7 +42,6 @@ RSpec.shared_context "Homebrew-Cask" do
FileUtils.rm_rf HOMEBREW_CASK_DIRS.values
FileUtils.rm_rf [Hbc::Config.global.binarydir, Hbc.caskroom, Hbc.cache]
Hbc.default_tap.path.unlink
FileUtils.rm_rf Hbc.default_tap.path.parent
third_party_tap.path.unlink
FileUtils.rm_rf third_party_tap.path.parent
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment