public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r11724 - main/trunk/pym/portage/dbapi
@ 2008-10-24 20:28 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-10-24 20:28 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2008-10-24 20:28:57 +0000 (Fri, 24 Oct 2008)
New Revision: 11724

Modified:
   main/trunk/pym/portage/dbapi/vartree.py
Log:
Fix preserve-libs code inside dblink.unmerge() so that it will join paths
correctly when ROOT != /.


Modified: main/trunk/pym/portage/dbapi/vartree.py
===================================================================
--- main/trunk/pym/portage/dbapi/vartree.py	2008-10-24 00:07:21 UTC (rev 11723)
+++ main/trunk/pym/portage/dbapi/vartree.py	2008-10-24 20:28:57 UTC (rev 11724)
@@ -1935,6 +1935,8 @@
 				# their real target before the object is found not to be
 				# in the reverse NEEDED map
 				def symlink_compare(x, y):
+					x = os.path.join(self.myroot, x.lstrip(os.path.sep))
+					y = os.path.join(self.myroot, y.lstrip(os.path.sep))
 					if os.path.islink(x):
 						if os.path.islink(y):
 							return 0
@@ -1947,20 +1949,23 @@
 
 				plib_dict[cpv].sort(symlink_compare)
 				for f in plib_dict[cpv]:
-					if not os.path.exists(f):
+					f_abs = os.path.join(self.myroot, f.lstrip(os.path.sep))
+					if not os.path.exists(f_abs):
 						continue
 					unlink_list = []
 					consumers = self.vartree.dbapi.linkmap.findConsumers(f)
 					if not consumers:
-						unlink_list.append(f)
+						unlink_list.append(f_abs)
 					else:
 						keep=False
 						for c in consumers:
+							c = os.path.join(self.myroot,
+								c.lstrip(os.path.sep))
 							if c not in self.getcontents():
 								keep=True
 								break
 						if not keep:
-							unlink_list.append(f)
+							unlink_list.append(f_abs)
 					for obj in unlink_list:
 						try:
 							if os.path.islink(obj):




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-24 20:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-24 20:28 [gentoo-commits] portage r11724 - main/trunk/pym/portage/dbapi Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox