[pacman-dev] directories symlinks removal

Nagy Gabor ngaba at bibl.u-szeged.hu
Fri Dec 21 08:32:08 EST 2007


> cddb_get 2.27-1 package contains the following directories :
> /usr/lib/perl5/5.8.8/
> /usr/lib/perl5/site_perl/5.8.8/
> 
> These 5.8.8 directories are normally symlinks to current/ on the
> filesystem.
> 
> When removing this package, or upgrading it to 2.27-2, the following
> errors show up:
> error: cannot remove file 'usr/lib/perl5/site_perl/5.8.8/': Not a
> directory error: cannot remove file 'usr/lib/perl5/5.8.8/': Not a
> directory
> 
> That's related to commit b55abdce7 (also see 2898ccb)
> 
> pacman now does a alpm_lstat of usr/lib/perl5/site_perl/5.8.8/, which
> does a lstat of usr/lib/perl5/5.8.8 , which gives a symlink.
> Then it tries to unlink(usr/lib/perl5/5.8.8/), which results in the
> above error.
> 
> I wonder if we shouldn't just revert to a simple lstat usage here.
> 

Give a look at this first:
---fileconflict003.py---
self.description = "Fileconflict with symlinks (3)"

lp = pmpkg("dummy")
lp.files = ["dir/realdir/",
            "dir/symdir -> realdir"]
self.addpkg2db("local", lp)

p1 = pmpkg("pkg1")
p1.files = ["dir/realdir/",
            "dir/symdir -> realdir"]
self.addpkg(p1)

self.args = "-A %s" % p1.filename()

self.addrule("PACMAN_RETCODE=1")
self.addrule("!PKG_EXIST=pkg1")
------------------------

So this is difficult symlink puzzle III or a packaging error, because I
assume that 5.8.8 directory is owned by more than one package, so
neither remove nor no-remove is a good solution here.

Back to the pactest: I'm not sure that this pactest should pass; our
packagers' life would be much more difficult if we didn't allow this. Or
in more general if a package want to overwrite an existing file, and if
md5sums match, we may(?) let multiple owners.
The only problem is, that currently we cannot handle multiple owners,
and that is not an easy game.

Bye




More information about the pacman-dev mailing list