From: Zac Medico Date: Fri, 15 Jun 2007 20:42:59 +0000 (-0000) Subject: Handle another case where removing a symlink to a directory can be harmful. (trunk... X-Git-Tag: v2.1.3~218 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a3534e11aea9e0b315faa331435291fa453f1b4d;p=portage.git Handle another case where removing a symlink to a directory can be harmful. (trunk r6852) svn path=/main/branches/2.1.2/; revision=6853 --- diff --git a/pym/portage.py b/pym/portage.py index dc8b3d842..31de417f1 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -7189,6 +7189,11 @@ class dblink: 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))