From: Zac Medico Date: Fri, 15 Jun 2007 20:42:32 +0000 (-0000) Subject: Handle another case where removing a symlink to a directory can be harmful. X-Git-Tag: v2.2_pre1~1235 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b730f94b2edff17b4f9d985e20a86987ad4a5948;p=portage.git Handle another case where removing a symlink to a directory can be harmful. svn path=/main/trunk/; revision=6852 --- diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index a773f8a50..5e397f099 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1224,6 +1224,11 @@ class dblink(object): if not islink: writemsg_stdout("--- !sym %s %s\n" % ("sym", obj)) continue + # Don't unlink symlinks to directories here since that can + # remove /lib and /usr/lib symlinks. + if statobj and stat.S_ISDIR(statobj.st_mode): + writemsg_stdout("--- !sym %s %s\n" % ("sym", obj)) + continue try: os.unlink(obj) writemsg_stdout("<<< %s %s\n" % ("sym", obj))