Remove the checks for files in symlinked directories
authorZac Medico <zmedico@gentoo.org>
Mon, 15 Oct 2007 18:46:12 +0000 (18:46 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 15 Oct 2007 18:46:12 +0000 (18:46 -0000)
from the collision protect code since it hasn't been
needed ever since the followSymlinks parameter was
disabled for portage.listdir() calls in order to
prevent infinite recursion loops. (trunk r8120:8124)

svn path=/main/branches/2.1.2/; revision=8131

pym/portage.py

index bd13d69fcb8261f1982f1542a51f6e6b9ea5e293..7245151b11688052a5109e58423d2ed724d87fdc 100644 (file)
@@ -7885,18 +7885,18 @@ class dblink:
                                if stat.S_ISREG(file_mode):
                                        myfilelist.append(file_path[len(srcroot):])
                                elif stat.S_ISLNK(file_mode):
+                                       # Note: os.walk puts symlinks to directories in the "dirs"
+                                       # list and it does not traverse them since that could lead
+                                       # to an infinite recursion loop.
                                        mylinklist.append(file_path[len(srcroot):])
 
                myfilelist.extend(mylinklist)
-               mysymlinks = mylinklist
                del mylinklist
 
                # check for package collisions
                if True:
                        collision_ignore = set([normalize_path(myignore) for myignore in \
                                self.settings.get("COLLISION_IGNORE", "").split()])
-                       mysymlinked_directories = [s + os.path.sep for s in mysymlinks]
-                       del mysymlinks
 
                        stopmerge=False
                        starttime=time.time()
@@ -7906,15 +7906,6 @@ class dblink:
                                os.path.sep
                        print green("*")+" checking "+str(len(myfilelist))+" files for package collisions"
                        for f in myfilelist:
-                               nocheck = False
-                               # listdir isn't intelligent enough to exclude symlinked dirs,
-                               # so we have to do it ourself
-                               for s in mysymlinked_directories:
-                                       if f.startswith(s):
-                                               nocheck = True
-                                               break
-                               if nocheck:
-                                       continue
                                i=i+1
                                if i % 1000 == 0:
                                        print str(i)+" files checked ..."