Created
June 28, 2012 07:17
-
-
Save bkabrda/3009644 to your computer and use it in GitHub Desktop.
Bundler distro mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/bundler.rb b/lib/bundler.rb | |
index 4df3ffb..9d88560 100644 | |
--- a/lib/bundler.rb | |
+++ b/lib/bundler.rb | |
@@ -353,3 +353,13 @@ module Bundler | |
end | |
end | |
+ | |
+if ENV['BUNDLER_DISTRO'].nil? || ! ENV['BUNDLER_DISTRO'].empty? | |
+ begin | |
+ require 'bundler/defaults/operating_system.rb' | |
+ Bundler.ui.info 'Bundler is running in distro mode.' | |
+ Bundler.ui.info 'Disable this by running with empty BUNDLER_DISTRO environment variable.' | |
+ rescue LoadError | |
+ # file not present => don't do anything | |
+ end | |
+end | |
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb | |
index 236eedd..9e041d6 100644 | |
--- a/lib/bundler/resolver.rb | |
+++ b/lib/bundler/resolver.rb | |
@@ -291,6 +291,10 @@ module Bundler | |
end | |
end | |
+ if respond_to? :distro_modify | |
+ matching_versions = distro_modify(matching_versions) | |
+ end | |
+ | |
matching_versions.reverse_each do |spec_group| | |
conflict = resolve_requirement(spec_group, current, reqs.dup, activated.dup) | |
conflicts << conflict if conflict |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment