diff options
-rw-r--r-- | src/CHANGES.txt | 2 | ||||
-rw-r--r-- | src/engine/SCons/Node/FS.py | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 4c89805..c0310e5 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -27,6 +27,8 @@ RELEASE 1.X - XXX - Fix a stack trace from the --debug=includes option when passed a static or shared library as an argument. + - Speed up the internal find_file() function (used for searching + CPPPATH, LIBPATH, etc.). RELEASE 1.1.0 - Thu, 09 Oct 2008 08:33:47 -0700 diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 8301b15..3268458 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -2967,14 +2967,11 @@ class FileFinder: except KeyError: pass - if verbose: + if verbose and not callable(verbose): if not SCons.Util.is_String(verbose): verbose = "find_file" - if not callable(verbose): - verbose = ' %s: ' % verbose - verbose = lambda s, v=verbose: sys.stdout.write(v + s) - else: - verbose = lambda x: x + verbose = ' %s: ' % verbose + verbose = lambda s, v=verbose: sys.stdout.write(v + s) filedir, filename = os.path.split(filename) if filedir: @@ -3013,10 +3010,12 @@ class FileFinder: result = None for dir in paths: - verbose("looking for '%s' in '%s' ...\n" % (filename, dir)) + if verbose: + verbose("looking for '%s' in '%s' ...\n" % (filename, dir)) node, d = dir.srcdir_find_file(filename) if node: - verbose("... FOUND '%s' in '%s'\n" % (filename, d)) + if verbose: + verbose("... FOUND '%s' in '%s'\n" % (filename, d)) result = node break |