    # File lib/rubygems/source_index.rb, line 331
      def update(source_uri, all)
        source_uri = URI.parse source_uri unless URI::Generic === source_uri
        source_uri.path += '/' unless source_uri.path =~ /\/$/

        use_incremental = false

        begin
          gem_names = fetch_quick_index source_uri, all
          remove_extra gem_names
          missing_gems = find_missing gem_names

          return false if missing_gems.size.zero?

          say "Missing metadata for #{missing_gems.size} gems" if
          missing_gems.size > 0 and Gem.configuration.really_verbose

          use_incremental = missing_gems.size <= Gem.configuration.bulk_threshold
        rescue Gem::OperationNotSupportedError => ex
          alert_error "Falling back to bulk fetch: #{ex.message}" if
          Gem.configuration.really_verbose
          use_incremental = false
        end

        if use_incremental then
          update_with_missing(source_uri, missing_gems)
        else
          new_index = fetch_bulk_index(source_uri)
          @gems.replace(new_index.gems)
        end

        true
      end