summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-15 20:42:32 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-15 20:42:32 +0000
commitb730f94b2edff17b4f9d985e20a86987ad4a5948 (patch)
treea01060206dd93809f75166b384a0a31cd82b2b12
parent5ee8eaa1c917ea709ee1eb19efd8528908e245ae (diff)
downloadportage-b730f94b2edff17b4f9d985e20a86987ad4a5948.tar.gz
portage-b730f94b2edff17b4f9d985e20a86987ad4a5948.tar.bz2
portage-b730f94b2edff17b4f9d985e20a86987ad4a5948.zip
Handle another case where removing a symlink to a directory can be harmful.
svn path=/main/trunk/; revision=6852
-rw-r--r--pym/portage/dbapi/vartree.py5
1 files changed, 5 insertions, 0 deletions
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))