It's probably a bit late to bring this up, but won't this remove -all- directories called build, not just -the- build directory? There's an os function that checks if two directories are the same. We can use that to compare the actual build directory with whatever we're recursing down. That would even catch hard links, I think, although hard linking your build directory would be a little weird.

Gabe

On 4/20/2011 11:20 AM, Brad Danofsky wrote:
changeset f52ece27e20d in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=f52ece27e20d
description:
        scons: Allow the build directory live under an EXTRAS directory

diffstat:

  src/SConscript |  4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff -r ee4e795343bf -r f52ece27e20d src/SConscript
--- a/src/SConscript    Tue Apr 19 18:45:23 2011 -0700
+++ b/src/SConscript    Wed Apr 20 11:14:51 2011 -0700
@@ -320,6 +320,10 @@
  for extra_dir in extras_dir_list:
      prefix_len = len(dirname(extra_dir)) + 1
      for root, dirs, files in os.walk(extra_dir, topdown=True):
+        # if build lives in the extras directory, don't walk down it
+        if 'build' in dirs:
+            dirs.remove('build')
+
          if 'SConscript' in files:
              build_dir = joinpath(env['BUILDDIR'], root[prefix_len:])
              SConscript(joinpath(root, 'SConscript'), variant_dir=build_dir)
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to