diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-06-15 20:42:59 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-06-15 20:42:59 +0000 |
commit | a3534e11aea9e0b315faa331435291fa453f1b4d (patch) | |
tree | e2ecba00f3fdfeb533b8b737531c4bcaaf68ce65 | |
parent | def36a667c634e9e16e9938b566f33aa979a5fae (diff) | |
download | portage-a3534e11aea9e0b315faa331435291fa453f1b4d.tar.gz portage-a3534e11aea9e0b315faa331435291fa453f1b4d.tar.bz2 portage-a3534e11aea9e0b315faa331435291fa453f1b4d.zip |
Handle another case where removing a symlink to a directory can be harmful. (trunk r6852)
svn path=/main/branches/2.1.2/; revision=6853
-rw-r--r-- | pym/portage.py | 5 |
1 files changed, 5 insertions, 0 deletions
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)) |