summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-01-09 18:54:09 +0000
committerZac Medico <zmedico@gentoo.org>2007-01-09 18:54:09 +0000
commit045385c4f079c6f0f4a30076ae1e366f6d7f5ef4 (patch)
treed26770610419ff844da1424dd0ae12ba3e5aa406
parenta42c0b4a19f17d96bd20ca4f30e626287dae5a30 (diff)
downloadportage-045385c4f079c6f0f4a30076ae1e366f6d7f5ef4.tar.gz
portage-045385c4f079c6f0f4a30076ae1e366f6d7f5ef4.tar.bz2
portage-045385c4f079c6f0f4a30076ae1e366f6d7f5ef4.zip
For bug #161103, don't skip collision-protect checks in cases where the beginning of the file path matches a symlink but is not acually inside a symlinked directory (check the path against symlink + os.path.sep).
svn path=/main/trunk/; revision=5499
-rw-r--r--pym/portage.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pym/portage.py b/pym/portage.py
index b16d3c711..52d49396d 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -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