diff options
author | Dirk Baechle <dl9obn@darc.de> | 2014-11-05 13:56:56 (GMT) |
---|---|---|
committer | Dirk Baechle <dl9obn@darc.de> | 2014-11-05 13:56:56 (GMT) |
commit | ad21677e236fb53db18f42402ec7f024f3e58a36 (patch) | |
tree | 2b3a9c9cf003d6627f278117b49fc8e60ba49c74 /src/engine/SCons/Node/FS.py | |
parent | 9866a7f445bb30e8cb16cc1f9c0225dfc1061ff5 (diff) | |
download | SCons-ad21677e236fb53db18f42402ec7f024f3e58a36.zip SCons-ad21677e236fb53db18f42402ec7f024f3e58a36.tar.gz SCons-ad21677e236fb53db18f42402ec7f024f3e58a36.tar.bz2 |
- added new method rentry_exists_on_disk (check for physical files/dirs)
Diffstat (limited to 'src/engine/SCons/Node/FS.py')
-rw-r--r-- | src/engine/SCons/Node/FS.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 219718c..e73dd92 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -1830,6 +1830,12 @@ class Dir(Base): return self.tpath + OS_SEP + name def entry_exists_on_disk(self, name): + """ Searches through the file/dir entries of the current + directory, and returns True if a physical entry with the given + name could be found. + + @see rentry_exists_on_disk + """ try: d = self.on_disk_entries except AttributeError: @@ -1854,6 +1860,33 @@ class Dir(Base): else: return name in d + def rentry_exists_on_disk(self, name): + """ Searches through the file/dir entries of the current + *and* all its remote directories (repos), and returns + True if a physical entry with the given name could be found. + The local directory (self) gets searched first, so + repositories take a lower precedence regarding the + searching order. + + @see entry_exists_on_disk + """ + + rentry_exists = self.entry_exists_on_disk(name) + if not rentry_exists: + # Search through the repository folders + norm_name = _my_normcase(name) + for rdir in self.get_all_rdirs(): + try: + node = rdir.entries[norm_name] + if node: + rentry_exists = True + break + except KeyError: + if rdir.entry_exists_on_disk(name): + rentry_exists = True + break + return rentry_exists + memoizer_counters.append(SCons.Memoize.CountValue('srcdir_list')) def srcdir_list(self): |