Context:
authorFabian Groffen <grobian@gentoo.org>
Sun, 13 Sep 2009 19:14:16 +0000 (19:14 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 13 Sep 2009 19:14:16 +0000 (19:14 -0000)
http://archives.gentoo.org/gentoo-alt/msg_2d3dfb3888ac4dcd4e64e1539ef039ff.xml

Let Portage not be tricked by symlinks when determining whether to
remove a directory.  This solves the case where the user added symlink
in place of the original directory and Portage would unmerge the
symlink.  With this patch Portage detects it is not dealing with a
directory but a symlink.  I think this is what was originally intended
in this code.  zmedico should give it a thorough look before merging
back to trunk.

svn path=/main/branches/prefix/; revision=14248

pym/portage/dbapi/vartree.py

index 2d30b16d6f5ec17fd80f50034135578eacd803fb..f1e60e491b128e21fa6ca3e5664e2cea0b6cde12 100644 (file)
@@ -3197,7 +3197,7 @@ class dblink(object):
                                        continue
 
                                if pkgfiles[objkey][0] == "dir":
-                                       if statobj is None or not stat.S_ISDIR(statobj.st_mode):
+                                       if lstatobj is None or not stat.S_ISDIR(lstatobj.st_mode):
                                                show_unmerge("---", unmerge_desc["!dir"], file_type, obj)
                                                continue
                                        mydirs.append(obj)