From 75d5e44211e997dbba91307f27c12f9c83579299 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 17 May 2012 13:20:48 -0700 Subject: [PATCH] movefile: fix abs symlink adjustment, bug #416431 --- pym/portage/util/movefile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pym/portage/util/movefile.py b/pym/portage/util/movefile.py index 5ffd16bf0..10577b565 100644 --- a/pym/portage/util/movefile.py +++ b/pym/portage/util/movefile.py @@ -141,9 +141,9 @@ def movefile(src, dest, newmtime=None, sstat=None, mysettings=None, if stat.S_ISLNK(sstat[stat.ST_MODE]): try: target=os.readlink(src) - if mysettings and mysettings["D"]: - if target.find(mysettings["D"])==0: - target=target[len(mysettings["D"]):] + if mysettings and "D" in mysettings and \ + target.startswith(mysettings["D"]): + target = target[len(mysettings["D"])-1:] if destexists and not stat.S_ISDIR(dstat[stat.ST_MODE]): os.unlink(dest) try: -- 2.26.2