# File lib/fpm/util.rb, line 160 def copy_entry(src, dst) case File.ftype(src) when 'fifo', 'characterSpecial', 'blockSpecial', 'socket' st = File.stat(src) rc = mknod_w(dst, st.mode, st.dev) raise SystemCallError.new("mknod error", FFI.errno) if rc == -1 when 'directory' FileUtils.mkdir(dst) unless File.exists? dst else # if the file with the same dev and inode has been copied already - # hard link it's copy to `dst`, otherwise make an actual copy st = File.lstat(src) known_entry = copied_entries[[st.dev, st.ino]] if known_entry FileUtils.ln(known_entry, dst) else FileUtils.copy_entry(src, dst) copied_entries[[st.dev, st.ino]] = dst end end # else... end