From: David Fox (fox@cs.nyu.edu)
Date: 01/02/93


From: fox@cs.nyu.edu (David Fox)
Subject: Re: A discipline for packages
Date: 3 Jan 1993 03:56:46 GMT

In article <bk^Q7dBX@twinsun.com> junio@twinsun.com (Jun Hamano) writes:

   Two more important reasons why a symbolic link is a nightmare
   are:

   (1) with a hard link, you can tell a file is pointed at by
   somebody else by looking at the target file, but a target file a
   symbolic file is pointing at doesn't know it is pointed at by
   somebody else at all; after removing such a file, the symbolic
   link pointing to it becomes an useless dangling link (it points
   to an non-existent file). With a hard link, you don't have this
   problem; the original disappears from the directory structure,
   but the file itself is not removed as long as any hard link is
   pointing to it.

   (2) with symbolic links, you have to be very careful not to tar
   off symbolic links without tarring the originals they are
   pointing at (unless the targets are well-known places in the
   directory tree); otherwise, when you unpack the tar archive, you
   will have only pointers and no real data ---useless dangling link
   again.

While these are indeed properties of symbolic links, you
can as easily view them as blessings as nightmares. We are
proposing to install the files for a package in one directory
tree and create symbolic links in the "guts" of the file
system. The nice thing about symbolic links is that they
can tell you where they are pointing, whereas all you know about
a hard link is how many other names it has. To de-install the
foo package you just remove every symbolic link anywhere that
points to /packages/foo/* and then rm -rf /packages/foo/*. If
you have a dangling link into /packages/foo/* you just get the
foo distribution and extract the missing file. If it is not there,
the link is not needed in this new version of foo and you can
remove it; but there is no need to. There is also little danger
of point (2), a distribution containing links but missing the real
files; if the distributer did a "tar cf - /packages/foo" there is no
way they will omit any real files. The tricky part is including
all the necessary links, but I don't think it is that tricky.

Furthermore, if you want to try out foo-1.3alpha you just make
/packages/foo a symbolic link to /packages/foo-1.3alpha. The
benefits are numerous.

-david