For bug #161103, don't skip collision-protect checks in cases where the beginning...
authorZac Medico <zmedico@gentoo.org>
Tue, 9 Jan 2007 18:54:09 +0000 (18:54 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 9 Jan 2007 18:54:09 +0000 (18:54 -0000)
svn path=/main/trunk/; revision=5499

pym/portage.py

index b16d3c7113a691f63a4b4ca3115ae400ffe1f895..52d49396d55d0f8790317ddf5141eef98e11b2ad 100644 (file)
@@ -7017,6 +7017,9 @@ class dblink:
                        os.chdir(srcroot)
                        mysymlinks = filter(os.path.islink, listdir(srcroot, recursive=1, filesonly=0, followSymlinks=False))
                        myfilelist.extend(mysymlinks)
+                       mysymlinked_directories = [s + os.path.sep for s in mysymlinks]
+                       del mysymlinks
+
 
                        stopmerge=False
                        starttime=time.time()
@@ -7043,10 +7046,10 @@ class dblink:
                                nocheck = False
                                # listdir isn't intelligent enough to exclude symlinked dirs,
                                # so we have to do it ourself
-                               for s in mysymlinks:
-                                       # the length comparison makes sure that the symlink itself is checked
-                                       if f[:len(s)] == s and len(f) > len(s):
+                               for s in mysymlinked_directories:
+                                       if f.startswith(s):
                                                nocheck = True
+                                               break
                                if nocheck:
                                        continue
                                i=i+1