Index: pym/portage.py =================================================================== --- pym/portage.py (revision 2441) +++ pym/portage.py (working copy) @@ -5664,7 +5664,6 @@ #process symlinks second-to-last, directories last. mydirs=[] - mysyms=[] modprotect="/lib/modules/" for obj in mykeys: obj=os.path.normpath(obj) @@ -5688,7 +5687,7 @@ lstatobj=os.lstat(obj) lmtime=str(lstatobj[stat.ST_MTIME]) - if (pkgfiles[obj][0] not in ("dir","fif","dev","sym")) and (lmtime != pkgfiles[obj][1]): + if (pkgfiles[obj][0] not in ("dir","fif","dev")) and (lmtime != pkgfiles[obj][1]): print "--- !mtime", pkgfiles[obj][0], obj continue @@ -5701,7 +5700,11 @@ if not os.path.islink(obj): print "--- !sym ","sym", obj continue - mysyms.append(obj) + try: + os.unlink(obj) + print "<<< ","sym",obj + except (OSError,IOError),e: + print "!!! ","sym",obj elif pkgfiles[obj][0]=="obj": if not os.path.isfile(obj): print "--- !obj ","obj", obj @@ -5730,43 +5733,13 @@ elif pkgfiles[obj][0]=="dev": print "--- ","dev",obj - #Now, we need to remove symlinks and directories. We'll repeatedly - #remove dead symlinks, then directories until we stop making progress. - #This is how we'll clean up directories containing symlinks pointing to - #directories that are now empty. These cases will require several - #iterations through our two-stage symlink/directory cleaning loop. - - #main symlink and directory removal loop: - #progress -- are we making progress? Initialized to 1 so loop will start progress=1 while progress: #let's see if we're able to make progress this iteration... progress=0 - #step 1: remove all the dead symlinks we can... - pos = 0 - while pos