summaryrefslogtreecommitdiffstats
path: root/pym/portage.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-07-13 06:54:14 +0000
committerZac Medico <zmedico@gentoo.org>2006-07-13 06:54:14 +0000
commitb0f8b86d81642a17a4858d815e1dff5cf7559643 (patch)
tree7fe0908ce4475c7adf73041530a749d1dc418c6c /pym/portage.py
parentad7efdcfaf55fc1cc30d8960f93f57412b2d747e (diff)
downloadportage-b0f8b86d81642a17a4858d815e1dff5cf7559643.tar.gz
portage-b0f8b86d81642a17a4858d815e1dff5cf7559643.tar.bz2
portage-b0f8b86d81642a17a4858d815e1dff5cf7559643.zip
Fix incorrect path handling in parts of symlink merge logic.
svn path=/main/trunk/; revision=3843
Diffstat (limited to 'pym/portage.py')
-rw-r--r--pym/portage.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 8f0609c17..acaefa30b 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -6495,8 +6495,7 @@ class dblink:
myabsto=abssymlink(mysrc)
if myabsto.startswith(srcroot):
myabsto=myabsto[len(srcroot):]
- if myabsto[0]!="/":
- myabsto="/"+myabsto
+ myabsto = myabsto.lstrip(sep)
myto=os.readlink(mysrc)
if self.settings and self.settings["D"]:
if myto.startswith(self.settings["D"]):
@@ -6517,12 +6516,17 @@ class dblink:
pass
elif self.isprotected(mydest):
# Use md5 of the target in ${D} if it exists...
- if os.path.exists(os.path.normpath(srcroot+myabsto)):
- mydest = new_protect_filename(mydest,
- newmd5=portage_checksum.perform_md5(srcroot+myabsto))
- else:
- mydest = new_protect_filename(mydest,
- newmd5=portage_checksum.perform_md5(myabsto))
+ try:
+ newmd5 = portage_checksum.perform_md5(
+ join(srcroot, myabsto))
+ except portage_exception.FileNotFound:
+ # Maybe the target is merged already.
+ try:
+ newmd5 = portage_checksum.perform_md5(
+ myrealto)
+ except portage_exception.FileNotFound:
+ newmd5 = None
+ mydest = new_protect_filename(mydest,newmd5=newmd5)
# if secondhand is None it means we're operating in "force" mode and should not create a second hand.
if (secondhand!=None) and (not os.path.exists(myrealto)):