summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHomu <homu@barosl.com>2016-08-09 14:37:27 +0900
committerHomu <homu@barosl.com>2016-08-09 14:37:27 +0900
commit114d42b4591f18bffac0af1b87f5bc37a41d81e6 (patch)
tree1798a32e4ea1ea1411a974d664a1358fabe6e7d1
parent8691b2293a9ca785f2554b2c4a80c71d5cf993a3 (diff)
parent64bc84e82692dd2e6b65c19e5cb42e41ef8852f1 (diff)
downloadbundler-114d42b4591f18bffac0af1b87f5bc37a41d81e6.tar.gz
Auto merge of #4842 - bundler:seg-setup-trampoline, r=indirect
[Setup] Only add bundler to the load path if we havent trampolined @indirect this should fix the stack overflow bug!
-rw-r--r--lib/bundler/postit_trampoline.rb6
-rw-r--r--lib/bundler/setup.rb9
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/bundler/postit_trampoline.rb b/lib/bundler/postit_trampoline.rb
index 950a77341f..dbb23aa4d9 100644
--- a/lib/bundler/postit_trampoline.rb
+++ b/lib/bundler/postit_trampoline.rb
@@ -53,9 +53,9 @@ The error was: #{e}
nil
end
- if Gem::Requirement.new(">= 1.13.pre".dup).satisfied_by?(Gem::Version.new(running_version))
- ENV["BUNDLE_POSTIT_TRAMPOLINING_VERSION"] = installed_version.to_s
- elsif ARGV.empty? || ARGV.any? {|a| %w(install i).include? a }
+ ENV["BUNDLE_POSTIT_TRAMPOLINING_VERSION"] = installed_version.to_s
+
+ if !Gem::Requirement.new(">= 1.13.pre".dup).satisfied_by?(Gem::Version.new(running_version)) && (ARGV.empty? || ARGV.any? {|a| %w(install i).include? a })
puts <<-WARN.strip
You're running Bundler #{installed_version} but this project uses #{running_version}. To update, run `bundle update --bundler`.
WARN
diff --git a/lib/bundler/setup.rb b/lib/bundler/setup.rb
index c888dabf2c..8b4b479778 100644
--- a/lib/bundler/setup.rb
+++ b/lib/bundler/setup.rb
@@ -20,9 +20,12 @@ if Bundler::SharedHelpers.in_bundle?
Bundler.setup
end
- # Add bundler to the load path after disabling system gems
- bundler_lib = File.expand_path("../..", __FILE__)
- $LOAD_PATH.unshift(bundler_lib) unless $LOAD_PATH.include?(bundler_lib)
+ unless ENV["BUNDLE_POSTIT_TRAMPOLINING_VERSION"]
+ # Add bundler to the load path after disabling system gems
+ # This is guarenteed to be done already if we've trampolined
+ bundler_lib = File.expand_path("../..", __FILE__)
+ $LOAD_PATH.unshift(bundler_lib) unless $LOAD_PATH.include?(bundler_lib)
+ end
Bundler.ui = nil
end