Index: main/trunk/pym/portage/dbapi/vartree.py =================================================================== --- main/trunk/pym/portage/dbapi/vartree.py (revision 14313) +++ main/trunk/pym/portage/dbapi/vartree.py (working copy) @@ -2464,21 +2464,10 @@ # 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: - unlink(obj, lstatobj) - except EnvironmentError as e: - if e.errno not in ignored_unlink_errnos: - raise - del e - show_unmerge("<<<", "", file_type, obj) - continue lmtime = str(lstatobj[stat.ST_MTIME]) - if (pkgfiles[objkey][0] not in ("dir", "fif", "dev")) and (lmtime != pkgfiles[objkey][1]): + # Don't check mtime if FEATURES=unmerge-orphans + if not unmerge_orphans and (pkgfiles[objkey][0] not in ("dir", "fif", "dev")) and (lmtime != pkgfiles[objkey][1]): show_unmerge("---", unmerge_desc["!mtime"], file_type, obj) continue @@ -2520,7 +2509,8 @@ # string.lower is needed because db entries used to be in upper-case. The # string.lower allows for backwards compatibility. - if mymd5 != pkgfiles[objkey][2].lower(): + # Don't check md5 if FEATURES=unmerge-orphans + if not unmerge_orphans and (mymd5 != pkgfiles[objkey][2].lower()): show_unmerge("---", unmerge_desc["!md5"], file_type, obj) continue try: