Bug #243022 - Inside dblink.mergeme(), when merging a directory and a symlink
authorZac Medico <zmedico@gentoo.org>
Sat, 15 Nov 2008 04:27:57 +0000 (04:27 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 15 Nov 2008 04:27:57 +0000 (04:27 -0000)
is in the way, verify that if points to a directory before accepting it,
otherwise move it out of the way.

svn path=/main/trunk/; revision=11920

pym/portage/dbapi/vartree.py

index 38d1081a41a4173eb92caa838ca2f89675b9ab7b..e78d32a6f8d32fef69b51ca81399b443a5194db3 100644 (file)
@@ -3674,7 +3674,8 @@ class dblink(object):
                                                writemsg("!!! And finish by running this: env-update\n\n")
                                                return 1
 
-                                       if stat.S_ISLNK(mydmode) or stat.S_ISDIR(mydmode):
+                                       if stat.S_ISDIR(mydmode) or \
+                                               (stat.S_ISLNK(mydmode) and os.path.isdir(mydest)):
                                                # a symlink to an existing directory will work for us; keep it:
                                                showMessage("--- %s/\n" % mydest)
                                                if bsd_chflags: