In dblink._preserve_libs(), strip leading $ROOT from contents paths so that
authorZac Medico <zmedico@gentoo.org>
Mon, 21 Jul 2008 06:08:38 +0000 (06:08 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 21 Jul 2008 06:08:38 +0000 (06:08 -0000)
it works when $ROOT != /.

svn path=/main/trunk/; revision=11155

pym/portage/dbapi/vartree.py

index f9e3fc9ed4aa92f298d4d3f3617a7a89e0ee8e66..2127cae0a7f3b1b567642e06668b49aa1fbb0658 100644 (file)
@@ -2107,8 +2107,10 @@ class dblink(object):
                liblist = linkmap.listLibraryObjects()
 
                # get list of libraries from old package instance
-               old_contents = self._installed_instance.getcontents().keys()
-               old_libs = set(old_contents).intersection(liblist)
+               root_len = len(self.myroot) - 1
+               old_contents = set(p[root_len:] \
+                       for p in self._installed_instance.getcontents())
+               old_libs = old_contents.intersection(liblist)
 
                # get list of libraries from new package instance
                mylibs = set([os.path.join(os.sep, x) for x in mycontents]).intersection(liblist)