summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Node/FS.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Node/FS.py')
-rw-r--r--src/engine/SCons/Node/FS.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 7c30333..a047903 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -355,6 +355,22 @@ class Entry(SCons.Node.Node):
else:
return self.srcpath
+ def get_contents(self):
+ """Fetch the contents of the entry.
+
+ Since this should return the real contents from the file
+ system, we check to see into what sort of subclass we should
+ morph this Entry."""
+ if os.path.isfile(self.abspath):
+ self.__class__ = File
+ self._morph()
+ return File.get_contents(self)
+ if os.path.isdir(self.abspath):
+ self.__class__ = Dir
+ self._morph()
+ return Dir.get_contents(self)
+ raise AttributeError
+
def exists(self):
return os.path.exists(str(self))
@@ -477,6 +493,10 @@ class Dir(Entry):
"""A directory has no signature."""
pass
+ def get_contents(self):
+ """Return a fixed "contents" value of a directory."""
+ return ''
+
def current(self):
"""If all of our children were up-to-date, then this
directory was up-to-date, too."""