extract_entry (Gem::Package::TarInput)

    # File lib/rubygems/package.rb, line 629
        def extract_entry(destdir, entry, expected_md5sum = nil)
          if entry.is_directory?
            dest = File.join(destdir, entry.full_name)
            if file_class.dir? dest
              @fileops.chmod entry.mode, dest, :verbose=>false
            else
              @fileops.mkdir_p(dest, :mode => entry.mode, :verbose=>false)
            end
            fsync_dir dest
            fsync_dir File.join(dest, "..")
            return
          end
          # it's a file
          md5 = Digest::MD5.new if expected_md5sum
          destdir = File.join(destdir, File.dirname(entry.full_name))
          @fileops.mkdir_p(destdir, :mode => 0755, :verbose=>false)
          destfile = File.join(destdir, File.basename(entry.full_name))
          @fileops.chmod(0600, destfile, :verbose=>false) rescue nil  # Errno::ENOENT
          file_class.open(destfile, "wb", entry.mode) do |os|
            loop do
              data = entry.read(4096)
              break unless data
              md5 << data if expected_md5sum
              os.write(data)
            end
            os.fsync
          end
          @fileops.chmod(entry.mode, destfile, :verbose=>false)
          fsync_dir File.dirname(destfile)
          fsync_dir File.join(File.dirname(destfile), "..")
          if expected_md5sum && expected_md5sum != md5.hexdigest
            raise BadCheckSum
          end
        end