From: Fabian Groffen Date: Sun, 13 Sep 2009 19:14:16 +0000 (-0000) Subject: Context: X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=e8dfba3de8905297190183931727125fb8ad0365;p=portage.git Context: 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 --- diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 2d30b16d6..f1e60e491 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -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)