aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/postinstall.rb4
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb7
-rw-r--r--Library/Homebrew/dev-cmd/create.rb2
-rw-r--r--Library/Homebrew/extend/os/mac/diagnostic.rb4
-rw-r--r--Library/Homebrew/os/mac/xcode.rb9
-rwxr-xr-xLibrary/Homebrew/shims/super/cc2
6 files changed, 21 insertions, 7 deletions
diff --git a/Library/Homebrew/cmd/postinstall.rb b/Library/Homebrew/cmd/postinstall.rb
index e8855b09e..8808a2602 100644
--- a/Library/Homebrew/cmd/postinstall.rb
+++ b/Library/Homebrew/cmd/postinstall.rb
@@ -37,8 +37,10 @@ module Homebrew
sandbox.allow_write_log(formula)
sandbox.allow_write_xcode
sandbox.deny_write_homebrew_repository
- sandbox.allow_write_path HOMEBREW_PREFIX
sandbox.allow_write_cellar(formula)
+ Keg::TOP_LEVEL_DIRECTORIES.each do |dir|
+ sandbox.allow_write_path "#{HOMEBREW_PREFIX}/#{dir}"
+ end
sandbox.exec(*args)
else
exec(*args)
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 0112c524f..540925947 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -1004,6 +1004,13 @@ class FormulaAuditor
problem "'fails_with :llvm' is now a no-op so should be removed"
end
+ if formula.tap.to_s == "homebrew/core"
+ ["OS.mac?", "OS.linux?"].each do |check|
+ next unless line.include?(check)
+ problem "Don't use #{check}; Homebrew/core only supports macOS"
+ end
+ end
+
return unless @strict
if line =~ /system ((["'])[^"' ]*(?:\s[^"' ]*)+\2)/
diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb
index 11544dbef..f684f95f6 100644
--- a/Library/Homebrew/dev-cmd/create.rb
+++ b/Library/Homebrew/dev-cmd/create.rb
@@ -119,7 +119,7 @@ class FormulaCreator
if @version
@version = Version.create(@version)
else
- @version = Pathname.new(url).version
+ @version = Version.detect(url, {})
end
end
diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb
index 157e7982b..55be7b191 100644
--- a/Library/Homebrew/extend/os/mac/diagnostic.rb
+++ b/Library/Homebrew/extend/os/mac/diagnostic.rb
@@ -116,7 +116,7 @@ module Homebrew
def check_xcode_minimum_version
return unless MacOS::Xcode.installed?
- return unless MacOS::Xcode.minimum_version?
+ return unless MacOS::Xcode.below_minimum_version?
<<-EOS.undent
Your Xcode (#{MacOS::Xcode.version}) is too outdated.
@@ -127,7 +127,7 @@ module Homebrew
def check_clt_minimum_version
return unless MacOS::CLT.installed?
- return unless MacOS::CLT.minimum_version?
+ return unless MacOS::CLT.below_minimum_version?
<<-EOS.undent
Your Command Line Tools are too outdated.
diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb
index bc1d66ef8..4ab863a5d 100644
--- a/Library/Homebrew/os/mac/xcode.rb
+++ b/Library/Homebrew/os/mac/xcode.rb
@@ -32,7 +32,7 @@ module OS
end
end
- def minimum_version?
+ def below_minimum_version?
version < minimum_version
end
@@ -231,11 +231,16 @@ module OS
end
end
- def minimum_version?
+ def below_minimum_version?
+ # Lion was the first version of OS X to ship with a CLT
+ return false if MacOS.version < :lion
version < minimum_version
end
def outdated?
+ # Lion was the first version of OS X to ship with a CLT
+ return false if MacOS.version < :lion
+
if MacOS.version >= :mavericks
version = Utils.popen_read("#{MAVERICKS_PKG_PATH}/usr/bin/clang --version")
else
diff --git a/Library/Homebrew/shims/super/cc b/Library/Homebrew/shims/super/cc
index 9d2ee0d34..b0ea705e8 100755
--- a/Library/Homebrew/shims/super/cc
+++ b/Library/Homebrew/shims/super/cc
@@ -31,7 +31,7 @@ class Cmd
@deps = Set.new(ENV.fetch("HOMEBREW_DEPENDENCIES") { "" }.split(","))
@formula_prefix = ENV["HOMEBREW_FORMULA_PREFIX"]
# matches opt or cellar prefix and formula name
- @keg_regex = %r[(#{Regexp.escape(opt)}|#{Regexp.escape(cellar)})/([\w\-_\+]+)]
+ @keg_regex = %r[(#{Regexp.escape(opt)}|#{Regexp.escape(cellar)})/([\w+-.@]+)]
end
def mode