Permalink
Browse files

holy fucking shit it kinda works

  • Loading branch information...
1 parent 4f414c9 commit 44088b2b81308bb9014db8a839c36bbb81606de0 osheroff committed Jan 21, 2012
Showing with 21 additions and 5 deletions.
  1. +13 −3 lib/bundler/definition.rb
  2. +0 −1 lib/bundler/resolver.rb
  3. +8 −1 lib/bundler/spec_set.rb
View
@@ -88,7 +88,6 @@ def resolve_remotely!
def specs
@specs ||= begin
resolved = resolve_with_local_override
- debugger if respond_to?(:debugger)
specs = resolved.materialize(requested_dependencies)
unless specs["bundler"].any?
@@ -161,8 +160,19 @@ def resolve_specs(with_local_override)
source_requirements["bundler_test_gem"] = path.specs
end
- # Run a resolve against the locally available gems
- last_resolve.merge Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, local_overrides)
+ local_resolve = Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, local_overrides)
+
+ # for all of the local-override gems that were resolved, pop them out of the lockfile-resolved list
+ # so that we don't duplicate gems
+ if local_overrides
+ local_resolve.to_a.each do |s|
+ if local_overrides[s.name] && last_resolve[s.name]
+ last_resolve.delete(s.name)
+ end
+ end
+ end
+
+ last_resolve.merge local_resolve
end
end
View
@@ -172,7 +172,6 @@ def resolve(reqs, activated)
#debug { print "\e[2J\e[f" ; "==== Iterating ====\n\n" }
debug { "iterating" }
- #puts caller.join("\n")
# Sort dependencies so that the ones that are easiest to resolve are first.
# Easiest to resolve is defined by:
View
@@ -14,7 +14,6 @@ def initialize(specs)
end
def for(dependencies, skip = [], check = false, match_current_platform = false)
- debugger
handled, deps, specs = {}, dependencies.dup, []
skip << 'bundler'
@@ -66,6 +65,14 @@ def []=(key, value)
value
end
+ def delete(key)
+ @specs.delete_if { |s| s.name == key }
+ @lookup = nil
+ @sorted = nil
+ lookup
+ sorted
+ end
+
def sort!
self
end

0 comments on commit 44088b2

Please sign in to comment.