For bug #182157, don't let unmerge-orphans unlink symlinks to directories since that...
authorZac Medico <zmedico@gentoo.org>
Fri, 15 Jun 2007 20:25:18 +0000 (20:25 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 15 Jun 2007 20:25:18 +0000 (20:25 -0000)
svn path=/main/trunk/; revision=6850

pym/portage/dbapi/vartree.py

index 182c129c4a4eea8e12c3465b63e32a0bb7cb922e..a773f8a50f0dc2a930b510464a813234f7cb067e 100644 (file)
@@ -1193,8 +1193,11 @@ class dblink(object):
                                        writemsg_stdout("--- cfgpro %s %s\n" % (pkgfiles[objkey][0], obj))
                                        continue
 
+                               # Don't unlink symlinks to directories here since that can
+                               # remove /lib and /usr/lib symlinks.
                                if unmerge_orphans and \
                                        lstatobj and not stat.S_ISDIR(lstatobj.st_mode) and \
+                                       not (islink and statobj and stat.S_ISDIR(statobj.st_mode)) and \
                                        not self.isprotected(obj):
                                        try:
                                                # Remove permissions to ensure that any hardlinks to