aboutsummaryrefslogtreecommitdiffstats
path: root/Library/ENV
diff options
context:
space:
mode:
authorAndrew Janke2016-04-13 02:53:41 -0400
committerAndrew Janke2016-04-13 10:41:01 -0400
commit36b2af2e0f5a72f0eccdec0c929a89188dc0f0dc (patch)
tree7ce2b1b5a0304dcb4e2ab0ab96a0e6b00a7c8a93 /Library/ENV
parenta8ed06ba741b627f48d2a9ec76f2aa62aec2c160 (diff)
downloadbrew-36b2af2e0f5a72f0eccdec0c929a89188dc0f0dc.tar.bz2
superenv: fix formula prefix path to consider revisions
Old logic doesn't include revision. This fixes that, and passes the whole formula prefix path to avoid duplicating the path-construction logic. Closes #80. Signed-off-by: Andrew Janke <andrew@apjanke.net>
Diffstat (limited to 'Library/ENV')
-rwxr-xr-xLibrary/ENV/4.3/cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc
index 6b3efd259..e7ab6500f 100755
--- a/Library/ENV/4.3/cc
+++ b/Library/ENV/4.3/cc
@@ -15,7 +15,7 @@ require "set"
class Cmd
attr_reader :config, :prefix, :cellar, :opt, :tmpdir, :sysroot, :deps
- attr_reader :archflags, :optflags, :keg_regex, :formula, :formula_version
+ attr_reader :archflags, :optflags, :keg_regex, :formula_prefix
def initialize(arg0, args)
@arg0 = arg0
@@ -29,8 +29,7 @@ class Cmd
@archflags = ENV.fetch("HOMEBREW_ARCHFLAGS") { "" }.split(" ")
@optflags = ENV.fetch("HOMEBREW_OPTFLAGS") { "" }.split(" ")
@deps = Set.new(ENV.fetch("HOMEBREW_DEPENDENCIES") { "" }.split(","))
- @formula = ENV["HOMEBREW_FORMULA"]
- @formula_version = ENV["HOMEBREW_FORMULA_VERSION"]
+ @formula_prefix = ENV["HOMEBREW_FORMULA_PREFIX"]
# matches opt or cellar prefix and formula name
@keg_regex = %r[(#{Regexp.escape(opt)}|#{Regexp.escape(cellar)})/([\w\-_\+]+)]
end
@@ -208,7 +207,7 @@ class Cmd
return keep_orig?(path) unless ENV["HOMEBREW_EXPERIMENTAL_FILTER_FLAGS_ON_DEPS"]
# Allow references to self
- if keg_path && path.start_with?(keg_path)
+ if formula_prefix && path.start_with?("#{formula_prefix}/")
true
# first two paths: reject references to Cellar or opt paths
# for unspecified dependencies
@@ -281,11 +280,6 @@ class Cmd
%W[#{sysroot}/usr/lib /usr/local/lib]
end
- def keg_path
- return nil if formula.nil?
- "#{cellar}/#{formula}/#{formula_version}"
- end
-
def configure?
# configure scripts generated with autoconf 2.61 or later export as_nl
ENV.key? "as_nl"