From: Zac Medico Date: Thu, 17 May 2012 20:20:48 +0000 (-0700) Subject: movefile: fix abs symlink adjustment, bug #416431 X-Git-Tag: v2.2.0_alpha108~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=75d5e44211e997dbba91307f27c12f9c83579299;p=portage.git movefile: fix abs symlink adjustment, bug #416431 --- 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: