summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-16 03:02:34 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-16 03:02:34 -0700
commit198bfde314e61d016c8a75aed1120295cfd4213d (patch)
tree74072be9663445e61109f2bc3903ef1f3e5baadc
parentd04da8d262673d45ff6f92d77d151d0fc871df57 (diff)
downloadportage-198bfde314e61d016c8a75aed1120295cfd4213d.tar.gz
portage-198bfde314e61d016c8a75aed1120295cfd4213d.tar.bz2
portage-198bfde314e61d016c8a75aed1120295cfd4213d.zip
Bug #332967 - In bintree.inject(), add a sanity check to make sure we
don't try to call movefile on a package that's already in the correct location.
-rw-r--r--pym/portage/dbapi/bintree.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index d84031681..2863b5c53 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -945,8 +945,9 @@ class binarytree(object):
wantnewlockfile=1)
if filename is not None:
new_filename = self.getname(cpv)
- self._ensure_dir(os.path.dirname(new_filename))
- _movefile(filename, new_filename, mysettings=self.settings)
+ if not os.path.samefile(filename, new_filename):
+ self._ensure_dir(os.path.dirname(new_filename))
+ _movefile(filename, new_filename, mysettings=self.settings)
if self._all_directory and \
self.getname(cpv).split(os.path.sep)[-2] == "All":
self._create_symlink(cpv)