Comment 18 for bug 1444347

Revision history for this message
Barry Warsaw (barry) wrote :

Okay, so we have two bugs here related to hardlinks. Here's the scenario:

In the source tarball:

'a' is a regular file with some contents
'b' is a hardlink to 'a'

In the target tarball:
'a' contains different contents, but 'b' still hardlinks to 'a'

Bug #1: If, in the target tarball, 'a' appears before 'b', we end up with a change set of [del-b, mod-a]. That's clearly not right since the target will lose the 'b' file.

Bug #2: If, in the target tarball 'b' appears before 'a', we end up with a change set of [mod-a]. That's not correct because 'a' will get a new inode when the target is unpacked, but 'b' will still be pointing at the old inode, i.e. at the wrong file.

In both cases, we want to modify 'a' and write a new 'b' that points to the new 'a'. I'm thinking maybe we want a new (internal) diff generation action of 'rep' == 'replace' for 'b', so we'd see a change set in both cases of [mod-a, rep-b]