It took some time for me to figure this out, but yay!
authorFabian Groffen <grobian@gentoo.org>
Mon, 24 Mar 2008 09:58:07 +0000 (09:58 -0000)
committerFabian Groffen <grobian@gentoo.org>
Mon, 24 Mar 2008 09:58:07 +0000 (09:58 -0000)
commit3f9bd5eea5bfc93c6d267456f71e9e8f1deaf335
tree9248b5b4aeae01d6ea754888d895fee1843490b9
parentb4af05fe7562ee2aeb50837940c254ef375a61bf
It took some time for me to figure this out, but yay!

Fix preserve-libs immediately unmerging a just preserved (copied over)
lib, because it is no longer needed (!needed).

The problem was/is that the Darwin library naming is
lib<name>.<ver>.dylib instead of lib<name>.so.<ver>.  This results in
doing a simple sort() over the list a wrong order of the files, such
that the actual file (libneon.27.1.11.dylib) is seen before it's "soname"
symlink, which is recorded in the reverse NEEDED map.  Result, the code
thinks libneon.27.1.11.dylib is no longer needed, and unmerges it.

I now implemented a naive comparator which puts symlinks on top, as this
was implied order for the loop, which by coincidence works for .so
objects with sort().

I think this commit (or an improved version of it) is eligable for
merging in the trunk, as it is a safer (and more explicit) way of
ensuring that symlinks are seen before the actual files.

svn path=/main/branches/prefix/; revision=9499
pym/portage/dbapi/vartree.py