summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-05-14 21:39:26 -0700
committerZac Medico <zmedico@gentoo.org>2011-05-25 19:50:54 -0700
commit272c1b19b0ab5681c566d8984cfaad1dba9df9fa (patch)
tree34d35dc59010cd49b46ff7eca35af2326230d0b5 /pym
parentfe0ef947e1b70ea8fae1f5dfe53949afa65c0eac (diff)
downloadportage-272c1b19b0ab5681c566d8984cfaad1dba9df9fa.tar.gz
portage-272c1b19b0ab5681c566d8984cfaad1dba9df9fa.tar.bz2
portage-272c1b19b0ab5681c566d8984cfaad1dba9df9fa.zip
movefile: handle EEXIST when os.symlink fails
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/util/movefile.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pym/portage/util/movefile.py b/pym/portage/util/movefile.py
index f8cc695fb..e07e8ca4f 100644
--- a/pym/portage/util/movefile.py
+++ b/pym/portage/util/movefile.py
@@ -90,7 +90,8 @@ def movefile(src, dest, newmtime=None, sstat=None, mysettings=None,
# to tolerate these links being recreated during the merge
# process. In any case, if the link is pointing at the right
# place, we're in good shape.
- if e.errno != errno.ENOENT or target != os.readlink(dest):
+ if e.errno not in (errno.ENOENT, errno.EEXIST) or \
+ target != os.readlink(dest):
raise
lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
# utime() only works on the target of a symlink, so it's not