[pacman-dev] Removing directory symlink support

Allan McRae allan at archlinux.org
Fri Apr 12 01:59:04 EDT 2013

The bugs in 4.1 are mostly addressed and I will make a 4.1.1 release
sometime soon, so now is time to think about pacman-4.2.

I wanted to discuss the removal of directory symlink support again
because there was not much response on the list last time.

Currently, if there is a symlink to a directory on the filesystem, we
can treat it like a directory.  e.g. Arch Linux has /lib -> usr/lib.  
So if a package installs a file in /lib, pacman silently puts it in

I'd like to remove that support for the following reasons:

1) It requires we resolve the true path of every directory involved in
an upgrade for conflict checking.  e.g. /lib/foo.so and /usr/lib/foo.so
are conflicts.  This has substantial overhead, both in terms of
computing and in code.  Removing this would mean all symlinks would be
treated like a file.

2) We do not handle it very well.  e.g. if a package contains a /foo ->
some/dir symlink, it needs to be installed before any package with a
file in /foo in the same transaction.  We "implement" this through
flagging a conflict.  When the package containing the directory symlink
is removed, we need to scan all packages to ensure it is not being
"used" by any other package in the local database.   This is covered by
the _failing_ pactests sync700-702.

3) If packages really want to install files in a directory where there
is a symlink, it is easily dealt with in the PKGBUILD.  e.g.

package() {
  ln -s usr/lib $pkgdir/lib
  make DESTDIR=$pkgdir
  rm $pkgdir/lib

4) There is no use case for it (at least on linux).  I have only ever
seen this used as a poor man's bind mount. 

5) It believe it would actually make replacing /bin and /sbin able to
occur in a single transaction (no --ignore filesystem) as we can replace
a completely removed directory by a file.

Any comments here?   I see there is a patchset already available that
does most (all?) of the removal.   What we would need is to have
something like a pacman-db-upgrade that changed filelists to avoid
symlink paths.  E.g a package with /lib/foo haves its filelist adjusted
to /usr/lib/foo.  The other option is to have testdb check for these and
advise people to run that before updating to pacman-4.2?

Any comments?


More information about the pacman-dev mailing list