aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/cmd/upgrade.rb8
-rw-r--r--Library/Homebrew/extend/os/linux/system_config.rb8
-rw-r--r--Library/Homebrew/formula_installer.rb2
-rw-r--r--Library/Homebrew/os/linux/glibc.rb14
4 files changed, 29 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb
index de886ff3d..9f8763904 100644
--- a/Library/Homebrew/cmd/upgrade.rb
+++ b/Library/Homebrew/cmd/upgrade.rb
@@ -119,9 +119,13 @@ module Homebrew
tab = Tab.for_keg(keg)
end
+ build_options = BuildOptions.new(Options.create(ARGV.flags_only), f.options)
+ options = build_options.used_options
+ options |= f.build.used_options
+ options &= f.options
+
fi = FormulaInstaller.new(f)
- fi.options = f.build.used_options
- fi.options &= f.options
+ fi.options = options
fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && f.build.build_bottle?)
fi.installed_on_request = !ARGV.named.empty?
fi.link_keg = keg_was_linked if keg_had_linked_opt
diff --git a/Library/Homebrew/extend/os/linux/system_config.rb b/Library/Homebrew/extend/os/linux/system_config.rb
index edb70058f..cf0176562 100644
--- a/Library/Homebrew/extend/os/linux/system_config.rb
+++ b/Library/Homebrew/extend/os/linux/system_config.rb
@@ -1,4 +1,5 @@
require "formula"
+require "os/linux/glibc"
class SystemConfig
class << self
@@ -14,6 +15,12 @@ class SystemConfig
end
end
+ def host_glibc_version
+ version = OS::Linux::Glibc.system_version
+ return "N/A" if version.null?
+ version
+ end
+
def host_gcc_version
gcc = Pathname.new "/usr/bin/gcc"
return "N/A" unless gcc.executable?
@@ -31,6 +38,7 @@ class SystemConfig
dump_generic_verbose_config(out)
out.puts "Kernel: #{`uname -mors`.chomp}"
out.puts "OS: #{host_os_version}"
+ out.puts "Host glibc: #{host_glibc_version}"
out.puts "/usr/bin/gcc: #{host_gcc_version}"
["glibc", "gcc", "xorg"].each do |f|
out.puts "#{f}: #{formula_linked_version f}"
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 10b0ae9cf..6d3984275 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -450,7 +450,7 @@ class FormulaInstaller
if (req.optional? || req.recommended?) && build.without?(req)
Requirement.prune
- elsif req.build? && use_default_formula && req_dependency.installed?
+ elsif req.build? && use_default_formula && req_dependency&.installed?
Requirement.prune
elsif install_requirement_formula?(req_dependency, req, dependent, install_bottle_for_dependent)
deps.unshift(req_dependency)
diff --git a/Library/Homebrew/os/linux/glibc.rb b/Library/Homebrew/os/linux/glibc.rb
new file mode 100644
index 000000000..710946bbc
--- /dev/null
+++ b/Library/Homebrew/os/linux/glibc.rb
@@ -0,0 +1,14 @@
+module OS
+ module Linux
+ module Glibc
+ module_function
+
+ def system_version
+ return @system_version if @system_version
+ version = Utils.popen_read("/usr/bin/ldd", "--version")[/ (\d+\.\d+)/, 1]
+ return Version::NULL unless version
+ @system_version = Version.new version
+ end
+ end
+ end
+end