Subject: bug#19616: [Bug-tar] dist tarball contains hardlinks

From: Paul Eggert <[email-masked]>
Date: Fri, 23 Jan 2015 08:19:55 -0800

Dimitrios Apostolou wrote:
> $ touch blah
> $ ln -s blah link_to_blah
> $ cp --dereference link_to_blah blah2
>
> The result is that "blah" and "blah2" have different inode!

Of course, and that's what one would expect, cp makes copies by default, and the 
copies have a different inode from the original.

I was referring to something like this:

touch blah
ln -s blah link_to_blah
mkdir dir
cp -a --dereference blah link_to_blah dir

This creates two hard links in dir, to the same new file.  ("-a" attempts to 
make "cp" act as much like "tar" as it can.)