From 0fb2725cb416499104457b42c93917efe477f6a6 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Fri, 12 Nov 2004 01:27:32 +0000 Subject: [PATCH] Better fix for reflective build_dir paths. (Kevin Quick) git-svn-id: http://scons.tigris.org/svn/scons/trunk@1157 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/engine/SCons/Node/FS.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 5ee4abf2..541e42ab 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -1098,7 +1098,7 @@ class FS(LocalFS): def CacheDir(self, path): self.CachePath = path - def build_dir_target_climb(self, dir, tail): + def build_dir_target_climb(self, orig, dir, tail): """Create targets in corresponding build directories Climb the directory tree, and look up path names @@ -1106,23 +1106,19 @@ class FS(LocalFS): """ targets = [] message = None + fmt = "building associated BuildDir targets: %s" start_dir = dir - start_tail = tail[:] while dir: for bd in dir.build_dirs: if start_dir.is_under(bd): # If already in the build-dir location, don't reflect - e = start_dir - if start_tail: - e = e.Entry(start_tail[0]) - targets.append(e) - continue + return [orig], fmt % str(orig) p = apply(os.path.join, [bd.path] + tail) targets.append(self.Entry(p)) tail = [dir.name] + tail dir = dir.up() if targets: - message = "building associated BuildDir targets: %s" % string.join(map(str, targets)) + message = fmt % string.join(map(str, targets)) return targets, message class Dir(Base): @@ -1276,7 +1272,7 @@ class Dir(Base): def alter_targets(self): """Return any corresponding targets in a build directory. """ - return self.fs.build_dir_target_climb(self, []) + return self.fs.build_dir_target_climb(self, self, []) def scanner_key(self): """A directory does not get scanned.""" @@ -1648,7 +1644,7 @@ class File(Base): """ if self.is_derived(): return [], None - return self.fs.build_dir_target_climb(self.dir, [self.name]) + return self.fs.build_dir_target_climb(self, self.dir, [self.name]) def is_pseudo_derived(self): return self.has_src_builder() -- 2.26.2