summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-04-13 13:49:21 (GMT)
committerSteven Knight <knight@baldmt.com>2005-04-13 13:49:21 (GMT)
commit4222b5aa00cf823693509e28a086b1fe7077482e (patch)
tree2fc86327262ad237e894e84d6c5a4157b9fa3abd
parent829d0fa89c2d93bb1461df2a8bb2fd2bb28a67da (diff)
downloadSCons-4222b5aa00cf823693509e28a086b1fe7077482e.zip
SCons-4222b5aa00cf823693509e28a086b1fe7077482e.tar.gz
SCons-4222b5aa00cf823693509e28a086b1fe7077482e.tar.bz2
Refactor the Rsearch*() methods out of existence in favor of simpler utility methods that return lists of repository directories.
-rw-r--r--src/engine/SCons/EnvironmentTests.py5
-rw-r--r--src/engine/SCons/Node/FS.py216
-rw-r--r--src/engine/SCons/Node/FSTests.py165
-rw-r--r--src/engine/SCons/Scanner/CTests.py8
-rw-r--r--src/engine/SCons/Scanner/FortranTests.py10
-rw-r--r--src/engine/SCons/Scanner/IDLTests.py10
-rw-r--r--src/engine/SCons/Scanner/ScannerTests.py4
-rw-r--r--src/engine/SCons/Scanner/__init__.py5
8 files changed, 171 insertions, 252 deletions
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py
index 6b4bc60..fcd0fee 100644
--- a/src/engine/SCons/EnvironmentTests.py
+++ b/src/engine/SCons/EnvironmentTests.py
@@ -799,10 +799,7 @@ class BaseTestCase(unittest.TestCase):
LIBLINKSUFFIX = 'bar')
def RDirs(pathlist, fs=env.fs):
- return fs.Rsearchall(pathlist,
- clazz=SCons.Node.FS.Dir,
- must_exist=0,
- cwd=fs.Dir('xx'))
+ return fs.Rfindalldirs(pathlist, fs.Dir('xx'))
env['RDirs'] = RDirs
flags = env.subst_list('$_LIBFLAGS', 1)[0]
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 90bc70a..6c644f6 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -894,7 +894,7 @@ class FS(LocalFS):
result = self.__checkClass(e, fsclass)
return result
- def __transformPath(self, name, directory):
+ def _transformPath(self, name, directory):
"""Take care of setting up the correct top-level directory,
usually in preparation for a call to doLookup().
@@ -947,7 +947,7 @@ class FS(LocalFS):
else:
if directory and not isinstance(directory, Dir):
directory = self.Dir(directory)
- name, directory = self.__transformPath(name, directory)
+ name, directory = self._transformPath(name, directory)
return self._doLookup(klass, name, directory, create)
def File(self, name, directory = None, create = 1):
@@ -1001,115 +1001,21 @@ class FS(LocalFS):
d = self.Dir(d)
self.Top.addRepository(d)
- def do_Rsearch(self, path, dir, func, clazz=_classEntry):
- """Search for something in a Repository. Returns the first
- one found in the list, or None if there isn't one.
- __cacheable__
- """
- d, name = os.path.split(path)
- norm_name = _my_normcase(name)
- if d:
- dir = dir.Dir(d)
- try:
- node = dir.entries[norm_name]
- except KeyError:
- node = dir.node_on_disk(name, clazz)
- else:
- node = func(node)
- if node:
- dir = node.get_dir()
- if node:
- return node, dir
- fname = '.'
- while dir:
- for rep in dir.getRepositories():
- rdir = rep.Dir(fname)
- try:
- node = rdir.entries[norm_name]
- except KeyError:
- node = rdir.node_on_disk(name, clazz)
- else:
- node = func(node)
- if node:
- return node, dir
- fname = dir.name + os.sep + fname
- dir = dir.get_dir()
- return None, None
-
- def Rsearch(self, path, clazz=_classEntry, cwd=None):
- if isinstance(path, SCons.Node.Node):
- return path
- def func(node, clazz=clazz):
- if node.exists() and \
- (isinstance(node, clazz) or isinstance(node, Entry) \
- or not node.is_derived()):
- return node
- return None
- path, dir = self.__transformPath(path, cwd)
- return self.do_Rsearch(path, dir, func, clazz)[0]
-
- def Rsearchall(self, pathlist, must_exist=1, clazz=_classEntry, cwd=None):
- """Search for a list of somethings in the Repository list.
- __cacheable__
- """
- result = []
+ def Rfindalldirs(self, pathlist, cwd):
+ """__cacheable__"""
if SCons.Util.is_String(pathlist):
pathlist = string.split(pathlist, os.pathsep)
if not SCons.Util.is_List(pathlist):
pathlist = [pathlist]
-
- if must_exist:
- select = lambda x, clazz=clazz: isinstance(x, clazz) and x.exists()
- else:
- select = lambda x, clazz=clazz: isinstance(x, clazz)
-
+ result = []
for path in filter(None, pathlist):
if isinstance(path, SCons.Node.Node):
result.append(path)
continue
-
- path, dir = self.__transformPath(path, cwd)
- d, name = os.path.split(path)
- norm_name = _my_normcase(name)
- if d:
- dir = dir.Dir(d)
- try:
- node = dir.entries[norm_name]
- except KeyError:
- # If there's no Node on disk, we'll filter
- # out the returned None below.
- if must_exist:
- n = dir.node_on_disk(name, clazz)
- else:
- n = self._doLookup(clazz, name, dir)
- dir.srcdir_duplicate(name, clazz)
- result.append(n)
- else:
- if not must_exist or node.exists():
- result.append(node)
- fname = '.'
- while dir:
- for rep in dir.getRepositories():
- rdir = rep.Dir(fname)
- try:
- node = rdir.entries[norm_name]
- except KeyError:
- # If there's no Node on disk, we'll filter
- # out the returned None below.
- if must_exist:
- n = rdir.node_on_disk(name, clazz)
- else:
- n = self._doLookup(clazz, name, rdir)
- rdir.srcdir_duplicate(name, clazz)
- result.append(n)
- else:
- if (not must_exist or node.exists()) and \
- (isinstance(node, Dir) or not node.is_derived()):
- result.append(node)
- fname = dir.name + os.sep + fname
- dir = dir.get_dir()
-
- return filter(None, result)
+ path, dir = self._transformPath(path, cwd)
+ dir = dir.Dir(path)
+ result.extend(dir.get_all_rdirs())
+ return result
def CacheDir(self, path):
self.CachePath = path
@@ -1214,21 +1120,26 @@ class Dir(Base):
srcdir.build_dirs.append(self)
def getRepositories(self):
- """Returns a list of repositories for this directory."""
+ """Returns a list of repositories for this directory.
+ __cacheable__"""
if self.srcdir and not self.duplicate:
- try:
- return self._srcreps
- except AttributeError:
- self._srcreps = self.fs.Rsearchall(self.srcdir.path,
- clazz=Dir,
- must_exist=0,
- cwd=self.fs.Top) \
- + self.repositories
- return self._srcreps
+ return self.srcdir.get_all_rdirs() + self.repositories
return self.repositories
+ def get_all_rdirs(self):
+ """__cacheable__"""
+ result = [self]
+ fname = '.'
+ dir = self
+ while dir:
+ for rep in dir.getRepositories():
+ result.append(rep.Dir(fname))
+ fname = dir.name + os.sep + fname
+ dir = dir.get_dir()
+ return result
+
def addRepository(self, dir):
- if not dir in self.repositories and dir != self:
+ if dir != self and not dir in self.repositories:
self.repositories.append(dir)
self.__clearRepositoryCache()
@@ -1378,12 +1289,15 @@ class Dir(Base):
def rdir(self):
"__cacheable__"
- rdir = self
if not self.exists():
- n = self.fs.Rsearch(self.path, clazz=Dir, cwd=self.fs.Top)
- if n:
- rdir = n
- return rdir
+ norm_name = _my_normcase(self.name)
+ for dir in self.dir.get_all_rdirs():
+ try: node = dir.entries[norm_name]
+ except KeyError: node = dir.dir_on_disk(self.name)
+ if node and node.exists() and \
+ (isinstance(dir, Dir) or isinstance(dir, Entry)):
+ return node
+ return self
def sconsign(self):
"""Return the .sconsign file info for this directory,
@@ -1451,12 +1365,12 @@ class Dir(Base):
return result
- def srcdir_duplicate(self, name, clazz):
+ def srcdir_duplicate(self, name):
for dir in self.srcdir_list():
if dir.entry_exists_on_disk(name):
- srcnode = self.fs._doLookup(clazz, name, dir)
+ srcnode = dir.File(name)
if self.duplicate:
- node = self.fs._doLookup(clazz, name, self)
+ node = self.File(name)
node.do_duplicate(srcnode)
return node
else:
@@ -1465,34 +1379,44 @@ class Dir(Base):
def srcdir_find_file(self, filename):
"""__cacheable__"""
- fs = self.fs
- do_Rsearch = fs.do_Rsearch
-
def func(node):
if (isinstance(node, File) or isinstance(node, Entry)) and \
(node.is_derived() or node.is_pseudo_derived() or node.exists()):
return node
return None
- node, d = do_Rsearch(filename, self, func, File)
- if node:
- return node, d
+ norm_name = _my_normcase(filename)
- for dir in self.srcdir_list():
- node, d = do_Rsearch(filename, dir, func, File)
+ for rdir in self.get_all_rdirs():
+ try: node = rdir.entries[norm_name]
+ except KeyError: node = rdir.file_on_disk(filename)
+ else: node = func(node)
if node:
- return File(filename, self, fs), d
+ return node, self
+
+ for srcdir in self.srcdir_list():
+ for rdir in srcdir.get_all_rdirs():
+ try: node = rdir.entries[norm_name]
+ except KeyError: node = rdir.file_on_disk(filename)
+ else: node = func(node)
+ if node:
+ return File(filename, self, self.fs), srcdir
+
return None, None
- def node_on_disk(self, name, clazz):
+ def dir_on_disk(self, name):
+ if self.entry_exists_on_disk(name):
+ try: return self.Dir(name)
+ except TypeError: pass
+ return None
+
+ def file_on_disk(self, name):
if self.entry_exists_on_disk(name) or \
self.sccs_on_disk(name) or \
self.rcs_on_disk(name):
- try:
- return self.fs._doLookup(clazz, name, self)
- except TypeError:
- pass
- return self.srcdir_duplicate(name, clazz)
+ try: return self.File(name)
+ except TypeError: pass
+ return self.srcdir_duplicate(name)
class RootDir(Dir):
"""A class for the root directory of a file system.
@@ -1548,8 +1472,7 @@ class File(Base):
def RDirs(self, pathlist):
"""Search for a list of directories in the Repository list."""
- return self.fs.Rsearchall(pathlist, clazz=Dir, must_exist=0,
- cwd=self.cwd)
+ return self.fs.Rfindalldirs(pathlist, self.cwd)
def _morph(self):
"""Turn a file system node into a File object. __cache_reset__"""
@@ -1869,13 +1792,16 @@ class File(Base):
def rfile(self):
"__cacheable__"
- rfile = self
if not self.exists():
- n = self.fs.Rsearch(self.path, clazz=File,
- cwd=self.fs.Top)
- if n:
- rfile = n
- return rfile
+ norm_name = _my_normcase(self.name)
+ for dir in self.dir.get_all_rdirs():
+ try: node = dir.entries[norm_name]
+ except KeyError: node = dir.file_on_disk(self.name)
+ if node and node.exists() and \
+ (isinstance(node, File) or isinstance(node, Entry) \
+ or not node.is_derived()):
+ return node
+ return self
def rstr(self):
return str(self.rfile())
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index e2c787e..22882d8 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -1335,11 +1335,11 @@ class DirTestCase(_tempdirTestCase):
src0 = self.fs.Dir('src0')
self.fs.BuildDir(bld0, src0, duplicate=0)
- n = bld0.srcdir_duplicate('does_not_exist', SCons.Node.FS.File)
+ n = bld0.srcdir_duplicate('does_not_exist')
assert n is None, n
assert not os.path.exists(test.workpath('bld0', 'does_not_exist'))
- n = bld0.srcdir_duplicate('exists', SCons.Node.FS.File)
+ n = bld0.srcdir_duplicate('exists')
assert str(n) == os.path.normpath('src0/exists'), str(n)
assert not os.path.exists(test.workpath('bld0', 'exists'))
@@ -1350,11 +1350,11 @@ class DirTestCase(_tempdirTestCase):
src1 = self.fs.Dir('src1')
self.fs.BuildDir(bld1, src1, duplicate=1)
- n = bld1.srcdir_duplicate('does_not_exist', SCons.Node.FS.File)
+ n = bld1.srcdir_duplicate('does_not_exist')
assert n is None, n
assert not os.path.exists(test.workpath('bld1', 'does_not_exist'))
- n = bld1.srcdir_duplicate('exists', SCons.Node.FS.File)
+ n = bld1.srcdir_duplicate('exists')
assert str(n) == os.path.normpath('bld1/exists'), str(n)
assert os.path.exists(test.workpath('bld1', 'exists'))
@@ -1506,6 +1506,36 @@ class DirTestCase(_tempdirTestCase):
n = bld1.srcdir_find_file('on-disk-e2')
check(n, ['bld1/on-disk-e2', 'bld1'])
+ def test_dir_on_disk(self):
+ """Test the Dir.dir_on_disk() method"""
+ self.test.subdir('sub', ['sub', 'exists'])
+ self.test.write(['sub', 'file'], "self/file\n")
+ sub = self.fs.Dir('sub')
+
+ r = sub.dir_on_disk('does_not_exist')
+ assert not r, r
+
+ r = sub.dir_on_disk('exists')
+ assert r, r
+
+ r = sub.dir_on_disk('file')
+ assert not r, r
+
+ def test_file_on_disk(self):
+ """Test the Dir.file_on_disk() method"""
+ self.test.subdir('sub', ['sub', 'dir'])
+ self.test.write(['sub', 'exists'], "self/exists\n")
+ sub = self.fs.Dir('sub')
+
+ r = sub.file_on_disk('does_not_exist')
+ assert not r, r
+
+ r = sub.file_on_disk('exists')
+ assert r, r
+
+ r = sub.file_on_disk('dir')
+ assert not r, r
+
class EntryTestCase(unittest.TestCase):
def runTest(self):
"""Test methods specific to the Entry sub-class.
@@ -1635,6 +1665,28 @@ class RepositoryTestCase(_tempdirTestCase):
r = map(lambda x, np=os.path.normpath: np(str(x)), rep)
assert r == expect, r
+ def test_get_all_rdirs(self):
+ """Test the Dir.get_all_rdirs() method"""
+ self.fs.Repository('foo')
+ self.fs.Repository(os.path.join('foo', 'bar'))
+ self.fs.Repository('bar/foo')
+ self.fs.Repository('bar')
+
+ expect = [
+ '.',
+ self.rep1,
+ self.rep2,
+ self.rep3,
+ 'foo',
+ os.path.join('foo', 'bar'),
+ os.path.join('bar', 'foo'),
+ 'bar'
+ ]
+
+ rep = self.fs.Dir('#').get_all_rdirs()
+ r = map(lambda x, np=os.path.normpath: np(str(x)), rep)
+ assert r == expect, r
+
def test_rdir(self):
"""Test the Dir.rdir() method"""
return_true = lambda: 1
@@ -1729,95 +1781,42 @@ class RepositoryTestCase(_tempdirTestCase):
r = e2.rfile()
assert r is re2, r
- def test_Rsearches(self):
- """Test the Rsearch() methods"""
+ def test_Rfindalldirs(self):
+ """Test the Rfindalldirs() methods"""
fs = self.fs
test = self.test
- test.write([self.rep1, 'f2'], "")
- test.subdir([self.rep2, 'f3'])
- test.write([self.rep3, 'f3'], "")
-
- r = fs.Rsearch('f1')
- assert r is None, r
-
- r = fs.Rsearch('f2')
- assert r, r
-
- f3 = fs.File('f3')
- r = fs.Rsearch(f3)
- assert r is f3, r
-
- def test_Rsearchall(self):
- """Test the Rsearchall() methods"""
- fs = self.fs
- test = self.test
-
- list = fs.Rsearchall(fs.Dir('d1'))
- assert len(list) == 1, list
- assert list[0].path == 'd1', list[0].path
-
- list = fs.Rsearchall([fs.Dir('d1')])
- assert len(list) == 1, list
- assert list[0].path == 'd1', list[0].path
-
- list = fs.Rsearchall('d2')
- assert list == [], list
-
- list = fs.Rsearchall('#d2')
- assert list == [], list
-
- fs.File('d2').built() # Clear exists cache
- test.subdir(['work', 'd2'])
-
- list = fs.Rsearchall('d2')
- assert map(str, list) == ['d2'], list
-
- fs.File('../rep2/d2').built() # Clear exists cache
- test.subdir(['rep2', 'd2'])
-
- list = fs.Rsearchall('d2')
- assert map(str, list) == ['d2', test.workpath('rep2', 'd2')], list
-
- fs.File('../rep1/d2').built() # Clear exists cache
- test.subdir(['rep1', 'd2'])
-
- list = fs.Rsearchall('d2')
- assert map(str, list) == ['d2',
- test.workpath('rep1', 'd2'),
- test.workpath('rep2', 'd2')], list
-
- list = fs.Rsearchall(['d3', 'd4'])
- assert list == [], list
-
- fs.File('d3').built() # Clear exists cache
- test.subdir(['work', 'd3'])
-
- list = map(str, fs.Rsearchall(['d3', 'd4']))
- assert list == ['d3'], list
-
- fs.File('../rep3/d4').built() # Clear exists cache
- test.subdir(['rep3', 'd4'])
+ d1 = fs.Dir('d1')
+ d2 = fs.Dir('d2')
+ rep1_d1 = fs.Dir(test.workpath('rep1', 'd1'))
+ rep2_d1 = fs.Dir(test.workpath('rep2', 'd1'))
+ rep3_d1 = fs.Dir(test.workpath('rep3', 'd1'))
+ sub = fs.Dir('sub')
+ sub_d1 = sub.Dir('d1')
+ rep1_sub_d1 = fs.Dir(test.workpath('rep1', 'sub', 'd1'))
+ rep2_sub_d1 = fs.Dir(test.workpath('rep2', 'sub', 'd1'))
+ rep3_sub_d1 = fs.Dir(test.workpath('rep3', 'sub', 'd1'))
- list = map(str, fs.Rsearchall(['d3', 'd4']))
- assert list == ['d3', test.workpath('rep3', 'd4')], list
+ r = fs.Rfindalldirs(d1, fs.Top)
+ assert r == [d1], map(str, r)
- list = map(str, fs.Rsearchall(string.join(['d3', 'd4'], os.pathsep)))
- assert list == ['d3', test.workpath('rep3', 'd4')], list
+ r = fs.Rfindalldirs([d1, d2], fs.Top)
+ assert r == [d1, d2], map(str, r)
- work_d4 = fs.File(os.path.join('work', 'd4'))
+ r = fs.Rfindalldirs('d1', fs.Top)
+ assert r == [d1, rep1_d1, rep2_d1, rep3_d1], map(str, r)
- list = map(str, fs.Rsearchall(['d3', work_d4]))
- assert list == ['d3', str(work_d4)], list
+ r = fs.Rfindalldirs('#d1', fs.Top)
+ assert r == [d1, rep1_d1, rep2_d1, rep3_d1], map(str, r)
- list = fs.Rsearchall('')
- assert list == [], list
+ r = fs.Rfindalldirs('d1', sub)
+ assert r == [sub_d1, rep1_sub_d1, rep2_sub_d1, rep3_sub_d1], map(str, r)
- list = fs.Rsearchall([None])
- assert list == [], list
+ r = fs.Rfindalldirs('#d1', sub)
+ assert r == [d1, rep1_d1, rep2_d1, rep3_d1], map(str, r)
- list = fs.Rsearchall([''])
- assert list == [], list
+ r = fs.Rfindalldirs(['d1', d2], fs.Top)
+ assert r == [d1, rep1_d1, rep2_d1, rep3_d1, d2], map(str, r)
def test_rexists(self):
"""Test the Entry.rexists() method"""
diff --git a/src/engine/SCons/Scanner/CTests.py b/src/engine/SCons/Scanner/CTests.py
index 138b788..c57e7f7 100644
--- a/src/engine/SCons/Scanner/CTests.py
+++ b/src/engine/SCons/Scanner/CTests.py
@@ -201,10 +201,10 @@ class DummyEnvironment(UserDict.UserDict):
return factory or self.fs.File
def Dir(self, filename):
- return self.fs.Dir(test.workpath(filename))
+ return self.fs.Dir(filename)
def File(self, filename):
- return self.fs.File(test.workpath(filename))
+ return self.fs.File(filename)
if os.path.normcase('foo') == os.path.normcase('FOO'):
my_normpath = os.path.normcase
@@ -303,8 +303,8 @@ class CScannerTestCase8(unittest.TestCase):
env.fs.chdir(env.Dir(''))
path = s.path(env, dir)
deps2 = s(env.File('#fa.cpp'), env, path)
- headers1 = ['include/fa.h', 'include/fb.h']
- headers2 = ['subdir/include/fa.h', 'subdir/include/fb.h']
+ headers1 = map(test.workpath, ['include/fa.h', 'include/fb.h'])
+ headers2 = ['include/fa.h', 'include/fb.h']
deps_match(self, deps1, headers1)
deps_match(self, deps2, headers2)
diff --git a/src/engine/SCons/Scanner/FortranTests.py b/src/engine/SCons/Scanner/FortranTests.py
index 141f375..da4a023 100644
--- a/src/engine/SCons/Scanner/FortranTests.py
+++ b/src/engine/SCons/Scanner/FortranTests.py
@@ -249,10 +249,10 @@ class DummyEnvironment:
return factory or self.fs.File
def Dir(self, filename):
- return self.fs.Dir(test.workpath(filename))
+ return self.fs.Dir(filename)
def File(self, filename):
- return self.fs.File(test.workpath(filename))
+ return self.fs.File(filename)
def deps_match(self, deps, headers):
scanned = map(os.path.normpath, map(str, deps))
@@ -382,8 +382,8 @@ class FortranScannerTestCase10(unittest.TestCase):
env.fs.chdir(env.Dir(''))
path = s.path(env, dir)
deps2 = s(env.File('#fff4.f'), env, path)
- headers1 = ['include/f4.f']
- headers2 = ['subdir/include/f4.f']
+ headers1 = map(test.workpath, ['include/f4.f'])
+ headers2 = ['include/f4.f']
deps_match(self, deps1, headers1)
deps_match(self, deps2, headers2)
@@ -416,7 +416,7 @@ class FortranScannerTestCase12(unittest.TestCase):
test.write('include/fff4.f', test.read('fff4.f'))
deps = s(env.File('#include/fff4.f'), env, path)
env.fs.chdir(env.Dir(''))
- deps_match(self, deps, ['include/f4.f'])
+ deps_match(self, deps, ['f4.f'])
test.unlink('include/fff4.f')
class FortranScannerTestCase13(unittest.TestCase):
diff --git a/src/engine/SCons/Scanner/IDLTests.py b/src/engine/SCons/Scanner/IDLTests.py
index d1a0941..5f2bb1f 100644
--- a/src/engine/SCons/Scanner/IDLTests.py
+++ b/src/engine/SCons/Scanner/IDLTests.py
@@ -226,10 +226,10 @@ class DummyEnvironment:
return factory or self.fs.File
def Dir(self, filename):
- return self.fs.Dir(test.workpath(filename))
+ return self.fs.Dir(filename)
def File(self, filename):
- return self.fs.File(test.workpath(filename))
+ return self.fs.File(filename)
global my_normpath
my_normpath = os.path.normpath
@@ -329,8 +329,8 @@ class IDLScannerTestCase7(unittest.TestCase):
env.fs.chdir(env.Dir(''))
path = s.path(env, dir)
deps2 = s(env.File('#t4.idl'), env, path)
- headers1 = ['include/fa.idl', 'include/fb.idl']
- headers2 = ['subdir/include/fa.idl', 'subdir/include/fb.idl']
+ headers1 = map(test.workpath, ['include/fa.idl', 'include/fb.idl'])
+ headers2 = ['include/fa.idl', 'include/fb.idl']
deps_match(self, deps1, headers1)
deps_match(self, deps2, headers2)
@@ -365,7 +365,7 @@ class IDLScannerTestCase9(unittest.TestCase):
test.write('include/t4.idl', test.read('t4.idl'))
deps = s(env.File('#include/t4.idl'), env, path)
env.fs.chdir(env.Dir(''))
- deps_match(self, deps, [ 'include/fa.idl', 'include/fb.idl' ])
+ deps_match(self, deps, [ 'fa.idl', 'fb.idl' ])
test.unlink('include/t4.idl')
class IDLScannerTestCase10(unittest.TestCase):
diff --git a/src/engine/SCons/Scanner/ScannerTests.py b/src/engine/SCons/Scanner/ScannerTests.py
index 0d0ccec..29ca063 100644
--- a/src/engine/SCons/Scanner/ScannerTests.py
+++ b/src/engine/SCons/Scanner/ScannerTests.py
@@ -35,8 +35,8 @@ class DummyFS:
self.search_result = search_result
def File(self, name):
return DummyNode(name)
- def Rsearchall(self, nodes, must_exist=0, clazz=None, cwd=dir):
- return self.search_result + nodes
+ def Rfindalldirs(self, pathlist, cwd):
+ return self.search_result + pathlist
class DummyEnvironment(UserDict.UserDict):
def __init__(self, dict=None, **kw):
diff --git a/src/engine/SCons/Scanner/__init__.py b/src/engine/SCons/Scanner/__init__.py
index 504b6df..3010159 100644
--- a/src/engine/SCons/Scanner/__init__.py
+++ b/src/engine/SCons/Scanner/__init__.py
@@ -88,10 +88,7 @@ class FindPathDirs:
return ()
path = env.subst_path(path, target=target, source=source)
- path_tuple = tuple(env.fs.Rsearchall(path,
- must_exist = 0, #kwq!
- clazz = SCons.Node.FS.Dir,
- cwd = dir))
+ path_tuple = tuple(env.fs.Rfindalldirs(path, dir))
return Binder(path_tuple)
class Base: