Skip to content

Instantly share code, notes, and snippets.

@bkabrda
Created June 28, 2012 07:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkabrda/3009644 to your computer and use it in GitHub Desktop.
Save bkabrda/3009644 to your computer and use it in GitHub Desktop.
Bundler distro mode
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