When comparing a resource that represents an absolute filename (the resource's name begins with a “/”), LPMtool is smart enough to recognize when seemingly different absolute filenames really refer to the same file, because of an intervening symlink.
Consider this: /usr/lib/foo
is a soft link to
/usr/lib/bar
.
In this case,
/usr/lib/foo/foobar
and
/usr/lib/bar/foobar
is really the same file.
LPMtool is smart enough to recognize this, and compare the resources accordingly.
LPMtool does this extra checking only if the last component of each filename
is the same.
If the last component of both files is different, they can't possibly refer
to the same file.
Otherwise, the following extra checking takes place:
LPMtool issues a lstat
() call on both files.
If both files exist, and their device numbers and inode numbers are the
same, than both filenames refer to the same file.
When a package is in a process of being installed,
it's possible that both files do not exist, but when they are eventually
created they will point to the same file.
If lstat
() indicates that the file does not exist,
the last component of the filename is repeatedly removed until
lstat
() succeeds, and returns the device number and
the inode number of the nearest existing parent directory.
If both files end up coming back with the same device and inode numbers,
and if the trailing, nonexisting, components of both filenames are the
same, then both filenames will refer to the same file.