aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/pin.rb3
-rw-r--r--Library/Homebrew/cmd/search.rb6
-rw-r--r--Library/Homebrew/cmd/unpin.rb4
-rwxr-xr-xLibrary/Homebrew/shims/super/cc2
-rw-r--r--Library/Homebrew/test/cmd/search_spec.rb8
-rw-r--r--Library/Homebrew/utils/curl.rb13
6 files changed, 28 insertions, 8 deletions
diff --git a/Library/Homebrew/cmd/pin.rb b/Library/Homebrew/cmd/pin.rb
index c5087f6d4..5a14f853c 100644
--- a/Library/Homebrew/cmd/pin.rb
+++ b/Library/Homebrew/cmd/pin.rb
@@ -1,6 +1,7 @@
#: * `pin` <formulae>:
#: Pin the specified <formulae>, preventing them from being upgraded when
-#: issuing the `brew upgrade` command. See also `unpin`.
+#: issuing the `brew upgrade <formulae>` command (but can still be upgraded
+#: as dependencies for other formulae). See also `unpin`.
require "formula"
diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb
index 5b83d80e2..0d47f8ab1 100644
--- a/Library/Homebrew/cmd/search.rb
+++ b/Library/Homebrew/cmd/search.rb
@@ -43,15 +43,15 @@ module Homebrew
Descriptions.search(regex, :desc).print
elsif ARGV.first =~ HOMEBREW_TAP_FORMULA_REGEX
query = ARGV.first
- user, repo, name = query.split("/", 3)
begin
result = Formulary.factory(query).name
+ results = Array(result)
rescue FormulaUnavailableError
- result = search_tap(user, repo, name)
+ _, _, name = query.split("/", 3)
+ results = search_taps(name)
end
- results = Array(result)
puts Formatter.columns(results) unless results.empty?
else
query = ARGV.first
diff --git a/Library/Homebrew/cmd/unpin.rb b/Library/Homebrew/cmd/unpin.rb
index a669df1ec..e15a156ea 100644
--- a/Library/Homebrew/cmd/unpin.rb
+++ b/Library/Homebrew/cmd/unpin.rb
@@ -1,6 +1,6 @@
#: * `unpin` <formulae>:
-#: Unpin <formulae>, allowing them to be upgraded by `brew upgrade`. See also
-#: `pin`.
+#: Unpin <formulae>, allowing them to be upgraded by `brew upgrade <formulae>`.
+#: See also `pin`.
require "formula"
diff --git a/Library/Homebrew/shims/super/cc b/Library/Homebrew/shims/super/cc
index d894d3d69..afe72156f 100755
--- a/Library/Homebrew/shims/super/cc
+++ b/Library/Homebrew/shims/super/cc
@@ -43,6 +43,8 @@ class Cmd
else
:cc
end
+ elsif @args.include?("-xc++-header") || @args.each_cons(2).include?(["-x", "c++-header"])
+ :cxx
elsif @args.include? "-E"
:ccE
else
diff --git a/Library/Homebrew/test/cmd/search_spec.rb b/Library/Homebrew/test/cmd/search_spec.rb
index bd2056a48..7c97e6e35 100644
--- a/Library/Homebrew/test/cmd/search_spec.rb
+++ b/Library/Homebrew/test/cmd/search_spec.rb
@@ -1,6 +1,7 @@
describe "brew search", :integration_test do
before(:each) do
setup_test_formula "testball"
+ setup_remote_tap "caskroom/cask"
end
it "lists all available Formulae when no argument is given" do
@@ -24,6 +25,13 @@ describe "brew search", :integration_test do
.and be_a_success
end
+ it "falls back to a tap search when no formula is found" do
+ expect { brew "search", "caskroom/cask/firefox" }
+ .to output(/firefox/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+
describe "--desc" do
let(:desc_cache) { HOMEBREW_CACHE/"desc_cache.json" }
diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb
index 9f0d8f75d..52d03c93e 100644
--- a/Library/Homebrew/utils/curl.rb
+++ b/Library/Homebrew/utils/curl.rb
@@ -11,7 +11,6 @@ end
def curl_args(*extra_args, show_output: false, user_agent: :default)
args = [
curl_executable.to_s,
- "--fail",
"--show-error",
]
@@ -25,6 +24,7 @@ def curl_args(*extra_args, show_output: false, user_agent: :default)
end
unless show_output
+ args << "--fail"
args << "--progress-bar" unless ARGV.verbose?
args << "--verbose" if ENV["HOMEBREW_CURL_VERBOSE"]
args << "--silent" if !$stdout.tty? || ENV["TRAVIS"]
@@ -38,7 +38,16 @@ def curl(*args)
end
def curl_download(*args, to: nil, **options)
- curl("--location", "--remote-time", "--continue-at", "-", "--output", to, *args, **options)
+ continue_at ||= "-"
+ curl("--location", "--remote-time", "--continue-at", continue_at, "--output", to, *args, **options)
+rescue ErrorDuringExecution
+ # `curl` error 33: HTTP server doesn't seem to support byte ranges. Cannot resume.
+ if $CHILD_STATUS.exitstatus == 33 && continue_at == "-"
+ continue_at = "0"
+ retry
+ end
+
+ raise
end
def curl_output(*args, **options)