    # File lib/chef/cookbook/synchronizer.rb, line 136
        def sync_cookbook(cookbook)
          Chef::Log.debug("Synchronizing cookbook #{cookbook.name}")

          # files and templates are lazily loaded, and will be done later.

          EAGER_SEGMENTS.each do |segment|
            segment_filenames = Array.new
            cookbook.manifest[segment].each do |manifest_record|

              cache_filename = sync_file_in_cookbook(cookbook, manifest_record)
              # make the segment filenames a full path.
              full_path_cache_filename = cache.load(cache_filename, false)
              segment_filenames << full_path_cache_filename
            end

            # replace segment filenames with a full-path one.
            if segment.to_sym == :recipes
              cookbook.recipe_filenames = segment_filenames
            elsif segment.to_sym == :attributes
              cookbook.attribute_filenames = segment_filenames
            else
              cookbook.segment_filenames(segment).replace(segment_filenames)
            end
          end
          @events.synchronized_cookbook(cookbook.name)
        end