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

svn path=/main/branches/2.1.6/; revision=11921

pym/portage/dbapi/vartree.py

index 31ad8880cd4e182f211cb6e064c379ef43306787..2555657ba6cb36a888030f6ca38b69ca370d0948 100644 (file)
@@ -2641,7 +2641,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: