Skip to content
This repository was archived by the owner on Mar 12, 2019. It is now read-only.

Commit 0e2dd5b

Browse files
committed
Merge tag Homebrew/1.8.1 into Linuxbrew/master
Conflicts: Dockerfile Library/Homebrew/diagnostic.rb Library/Homebrew/formula_installer.rb Library/Homebrew/test/formula_installer_bottle_spec.rb Library/Homebrew/test/spec_helper.rb README.md
2 parents 8f5de98 + 4222570 commit 0e2dd5b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+377
-333
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878
!/CHANGELOG.md
7979
!/CODE_OF_CONDUCT.md
8080
!/CONTRIBUTING.md
81+
!/Dockerfile
82+
!/Dockerfile.test.yml
8183
!/LICENSE.txt
8284
!/README.md
8385
!/Dockerfile

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ branches:
1313
only:
1414
- master
1515

16+
env:
17+
- HOMEBREW_FORCE_HOMEBREW_ON_LINUX=1
18+
1619
before_install:
1720
- HOMEBREW_REPOSITORY="$(brew --repo)"
1821
- sudo chown -R "$USER" "$HOMEBREW_REPOSITORY"
@@ -24,7 +27,7 @@ before_install:
2427
- travis_retry git clone --depth=1 https://github.com/Homebrew/homebrew-test-bot Library/Taps/homebrew/homebrew-test-bot
2528

2629
script:
27-
- brew test-bot
30+
- travis_wait 60 brew test-bot
2831

2932
notifications:
3033
slack:

Dockerfile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,23 @@ FROM ubuntu:xenial
22
LABEL maintainer="Shaun Jackman <[email protected]>"
33

44
RUN apt-get update \
5-
&& apt-get install -y --no-install-recommends bzip2 ca-certificates curl file fonts-dejavu-core g++ git locales make openssh-client patch sudo uuid-runtime \
5+
&& apt-get install -y --no-install-recommends software-properties-common \
6+
&& add-apt-repository -y ppa:git-core/ppa \
7+
&& apt-get update \
8+
&& apt-get install -y --no-install-recommends \
9+
bzip2 \
10+
ca-certificates \
11+
curl \
12+
file \
13+
fonts-dejavu-core \
14+
g++ \
15+
git \
16+
locales \
17+
make \
18+
openssh-client \
19+
patch \
20+
sudo \
21+
uuid-runtime \
622
&& rm -rf /var/lib/apt/lists/*
723

824
RUN localedef -i en_US -f UTF-8 en_US.UTF-8 \

Dockerfile.test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sut:
2+
build: .
3+
command: brew test-bot

Library/Homebrew/brew.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
homebrew_path = PATH.new(ENV["HOMEBREW_PATH"])
3838

3939
# Add SCM wrappers.
40-
path.append(HOMEBREW_SHIMS_PATH/"scm")
41-
homebrew_path.append(HOMEBREW_SHIMS_PATH/"scm")
40+
path.prepend(HOMEBREW_SHIMS_PATH/"scm")
41+
homebrew_path.prepend(HOMEBREW_SHIMS_PATH/"scm")
4242

4343
ENV["PATH"] = path
4444

Library/Homebrew/brew.sh

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ git() {
5555
"$HOMEBREW_LIBRARY/Homebrew/shims/scm/git" "$@"
5656
}
5757

58+
numeric() {
59+
# Condense the exploded argument into a single return value.
60+
# shellcheck disable=SC2086,SC2183
61+
printf "%01d%02d%02d%02d" ${1//./ }
62+
}
63+
5864
HOMEBREW_VERSION="$(git -C "$HOMEBREW_REPOSITORY" describe --tags --dirty --abbrev=7 2>/dev/null)"
5965
HOMEBREW_USER_AGENT_VERSION="$HOMEBREW_VERSION"
6066
if [[ -z "$HOMEBREW_VERSION" ]]
@@ -99,7 +105,8 @@ then
99105
HOMEBREW_FORCE_BREWED_CURL="1"
100106
fi
101107

102-
# The system Git is too old for some Homebrew functionality we rely on.
108+
# The system Git on macOS versions before Sierra is too old for some Homebrew functionality we rely on.
109+
HOMEBREW_MINIMUM_GIT_VERSION="2.14.3"
103110
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101200" ]]
104111
then
105112
HOMEBREW_FORCE_BREWED_GIT="1"
@@ -114,6 +121,25 @@ else
114121
: "${HOMEBREW_OS_VERSION:=$(uname -r)}"
115122
HOMEBREW_OS_USER_AGENT_VERSION="$HOMEBREW_OS_VERSION"
116123

124+
# Ensure the system Curl is a version that supports modern HTTPS certificates.
125+
HOMEBREW_MINIMUM_CURL_VERSION="7.41.0"
126+
system_curl_version_output="$($(command -v curl) --version 2>/dev/null)"
127+
system_curl_name_and_version="${system_curl_version_output%% (*}"
128+
if [[ $(numeric "${system_curl_name_and_version##* }") -lt $(numeric "$HOMEBREW_MINIMUM_CURL_VERSION") ]]
129+
then
130+
HOMEBREW_SYSTEM_CURL_TOO_OLD="1"
131+
HOMEBREW_FORCE_BREWED_CURL="1"
132+
fi
133+
134+
# Ensure the system Git is at or newer than the minimum required version.
135+
# Git 2.7.4 is the version of git on Ubuntu 16.04 LTS (Xenial Xerus).
136+
HOMEBREW_MINIMUM_GIT_VERSION="2.7.0"
137+
system_git_version_output="$($(command -v git) --version 2>/dev/null)"
138+
if [[ $(numeric "${system_git_version_output##* }") -lt $(numeric "$HOMEBREW_MINIMUM_GIT_VERSION") ]]
139+
then
140+
HOMEBREW_FORCE_BREWED_GIT="1"
141+
fi
142+
117143
CACHE_HOME="${XDG_CACHE_HOME:-${HOME}/.cache}"
118144
HOMEBREW_CACHE="${HOMEBREW_CACHE:-${CACHE_HOME}/Homebrew}"
119145
HOMEBREW_SYSTEM_TEMP="/tmp"
@@ -153,8 +179,9 @@ else
153179
fi
154180

155181
HOMEBREW_USER_AGENT="$HOMEBREW_PRODUCT/$HOMEBREW_USER_AGENT_VERSION ($HOMEBREW_SYSTEM; $HOMEBREW_PROCESSOR $HOMEBREW_OS_USER_AGENT_VERSION)"
156-
HOMEBREW_CURL_VERSION="$("$HOMEBREW_CURL" --version 2>/dev/null | head -n1 | awk '{print $1"/"$2}')"
157-
HOMEBREW_USER_AGENT_CURL="$HOMEBREW_USER_AGENT $HOMEBREW_CURL_VERSION"
182+
curl_version_output="$("$HOMEBREW_CURL" --version 2>/dev/null)"
183+
curl_name_and_version="${curl_version_output%% (*}"
184+
HOMEBREW_USER_AGENT_CURL="$HOMEBREW_USER_AGENT ${curl_name_and_version// //}"
158185

159186
# Declared in bin/brew
160187
export HOMEBREW_BREW_FILE
@@ -172,6 +199,7 @@ export HOMEBREW_SYSTEM
172199
export HOMEBREW_CURL
173200
export HOMEBREW_SYSTEM_CURL_TOO_OLD
174201
export HOMEBREW_GIT
202+
export HOMEBREW_MINIMUM_GIT_VERSION
175203
export HOMEBREW_PROCESSOR
176204
export HOMEBREW_PRODUCT
177205
export HOMEBREW_OS_VERSION

Library/Homebrew/cask/artifact/abstract_uninstall.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ def uninstall_signal(*signals, command: nil, **_)
169169
end
170170
end
171171

172-
def uninstall_login_item(*login_items, command: nil, **_)
172+
def uninstall_login_item(*login_items, command: nil, upgrade: false, **_)
173+
return if upgrade
174+
173175
login_items.each do |name|
174176
ohai "Removing login item #{name}"
175177
command.run!(

Library/Homebrew/cask/installer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def uninstall_artifacts(clear: false)
424424
next unless artifact.respond_to?(:uninstall_phase)
425425

426426
odebug "Un-installing artifact of class #{artifact.class}"
427-
artifact.uninstall_phase(command: @command, verbose: verbose?, skip: clear, force: force?)
427+
artifact.uninstall_phase(command: @command, verbose: verbose?, skip: clear, force: force?, upgrade: upgrade?)
428428
end
429429
end
430430

Library/Homebrew/cli_parser.rb

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,12 @@ def post_initialize
4242

4343
def switch(*names, description: nil, env: nil, required_for: nil, depends_on: nil)
4444
global_switch = names.first.is_a?(Symbol)
45-
names, env, description = common_switch(*names) if global_switch
46-
description = option_to_description(*names) if description.nil?
45+
names, env, default_description = common_switch(*names) if global_switch
46+
if description.nil? && global_switch
47+
description = default_description
48+
elsif description.nil?
49+
description = option_to_description(*names)
50+
end
4751
process_option(*names, description)
4852
@parser.on(*names, *wrap_option_desc(description)) do
4953
enable_switch(*names)
@@ -72,20 +76,24 @@ def comma_array(name, description: nil)
7276
end
7377
end
7478

75-
def flag(name, description: nil, required_for: nil, depends_on: nil)
76-
if name.end_with? "="
79+
def flag(*names, description: nil, required_for: nil, depends_on: nil)
80+
if names.any? { |name| name.end_with? "=" }
7781
required = OptionParser::REQUIRED_ARGUMENT
78-
name.chomp! "="
7982
else
8083
required = OptionParser::OPTIONAL_ARGUMENT
8184
end
82-
description = option_to_description(name) if description.nil?
83-
process_option(name, description)
84-
@parser.on(name, *wrap_option_desc(description), required) do |option_value|
85-
Homebrew.args[option_to_name(name)] = option_value
85+
names.map! { |name| name.chomp "=" }
86+
description = option_to_description(*names) if description.nil?
87+
process_option(*names, description)
88+
@parser.on(*names, *wrap_option_desc(description), required) do |option_value|
89+
names.each do |name|
90+
Homebrew.args[option_to_name(name)] = option_value
91+
end
8692
end
8793

88-
set_constraints(name, required_for: required_for, depends_on: depends_on)
94+
names.each do |name|
95+
set_constraints(name, required_for: required_for, depends_on: depends_on)
96+
end
8997
end
9098

9199
def conflicts(*options)
@@ -118,6 +126,7 @@ def parse(cmdline_args = ARGV)
118126
remaining_args = @parser.parse(cmdline_args)
119127
check_constraint_violations
120128
Homebrew.args[:remaining] = remaining_args
129+
Homebrew.args.freeze
121130
@parser
122131
end
123132

Library/Homebrew/cmd/diy.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ def diy
2525
puts "-DCMAKE_INSTALL_PREFIX=#{prefix}"
2626
elsif File.file? "configure"
2727
puts "--prefix=#{prefix}"
28+
elsif File.file? "meson.build"
29+
puts "-Dprefix=#{prefix}"
2830
else
29-
raise "Couldn't determine build system"
31+
raise "Couldn't determine build system. You can manually put files into #{prefix}"
3032
end
3133
end
3234

0 commit comments

Comments
 (0)