class Bundler::Resolver

def search(dep)

def search(dep)
  if base = @base[dep.name] and base.any?
    reqs = [dep.requirement.as_list, base.first.version.to_s].flatten.compact
    d = Gem::Dependency.new(base.first.name, *reqs)
  else
    d = dep.dep
  end
  @deps_for[d.hash] ||= begin
    index = @source_requirements[d.name] || @index
    results = index.search(d, @base[d.name])
    if results.any?
      version = results.first.version
      nested  = [[]]
      results.each do |spec|
        if spec.version != version
          nested << []
          version = spec.version
        end
        nested.last << spec
      end
      deps = nested.map{|a| SpecGroup.new(a) }.select{|sg| sg.for?(dep.__platform) }
    else
      deps = []
    end
  end
end