From: Zac Medico Date: Mon, 15 Oct 2007 18:46:12 +0000 (-0000) Subject: Remove the checks for files in symlinked directories X-Git-Tag: v2.1.3.16~32 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d89a7851ef6c78dc1f5f05c4e37627ecd347c930;p=portage.git Remove the checks for files in symlinked directories 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 --- diff --git a/pym/portage.py b/pym/portage.py index bd13d69fc..7245151b1 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -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 ..."