MacPorts duplicate files or hardlinks?

Bryan Blackburn blb at macports.org
Sun May 24 16:01:09 PDT 2009


On Sun, May 24, 2009 at 12:03:06PM -0700, Bee said:
> MacPorts 1.7 selfupdate (recently)
> MacOS 10.4.11
>
> MacPorts seems to keep many duplicate files.
>
> As an example, I did a search for duplicates I found these identical  
> files:
>
> /opt/local/bin/vim
> /opt/local/var/macports/software/vim/7.2.182_0/opt/local/bin/vim
>
> Are these really a duplicate files or a hardlink?
> I think the "2" before the "root" means it has a hardlink. Is that  
> correct?
>
> -rwxr-xr-x   2 root  admin  - 1462888 May 17 22:26 vim
>
> If duplicate files:
> + Is there a reason both are kept?

Yes, the files in .../var/macports/software is what's called an image, for
all the low-level details see the guide:

<http://guide.macports.org/#internals.images>

Basically a given port is first installed in this directory, then when it is
activated hard links are created in just ${prefix} to the stuff in
.../var/macports/software so it can be visible.

> + Is there a way to "clean" duplicates?

Since it uses hardlinks it shouldn't be really taking up twice the amount of
diskspace, but of course it does create another link for every file.  The
more common disk space user is having multiple installs of a port when you
only need the current (happens with 'port upgrade outdated' which doesn't
uninstall the older version).  To clean those you can use 'sudo port
uninstall inactive' to remove those (assuming all ports you have which are
inactive are not wanted).

Long-term, the way images are handled should be changing by not doing the
install-then-hardlink style, see ticket #19458:

<http://trac.macports.org/ticket/19458>

Bryan


>
> --
> Bill Muench
> Santa Cruz, California


More information about the macports-users mailing list