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

pym/portage.py

index 88bc3816c250bb25b636b53eb16ef1c603b42e4b..dc8b3d842537a1819841a9446e305cebfe7e4018 100644 (file)
@@ -7158,8 +7158,11 @@ class dblink:
                                        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