From c9ae6bea9758fca29c0fd153eee1e89dc3905983 Mon Sep 17 00:00:00 2001 From: GregNoel Date: Fri, 7 Nov 2008 01:34:18 +0000 Subject: [PATCH] Issue 2235: File.Dir() creates files in the wrong place git-svn-id: http://scons.tigris.org/svn/scons/trunk@3770 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/engine/SCons/Node/FS.py | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 3268458d..e04bacd4 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -1171,7 +1171,7 @@ class FS(LocalFS): return root._lookup_abs(p, fsclass, create) def Entry(self, name, directory = None, create = 1): - """Lookup or create a generic Entry node with the specified name. + """Look up or create a generic Entry node with the specified name. If the name is a relative path (begins with ./, ../, or a file name), then it is looked up relative to the supplied directory node, or to the top level directory of the FS (supplied at @@ -1180,7 +1180,7 @@ class FS(LocalFS): return self._lookup(name, directory, Entry, create) def File(self, name, directory = None, create = 1): - """Lookup or create a File node with the specified name. If + """Look up or create a File node with the specified name. If the name is a relative path (begins with ./, ../, or a file name), then it is looked up relative to the supplied directory node, or to the top level directory of the FS (supplied at construction @@ -1192,7 +1192,7 @@ class FS(LocalFS): return self._lookup(name, directory, File, create) def Dir(self, name, directory = None, create = True): - """Lookup or create a Dir node with the specified name. If + """Look up or create a Dir node with the specified name. If the name is a relative path (begins with ./, ../, or a file name), then it is looked up relative to the supplied directory node, or to the top level directory of the FS (supplied at construction @@ -1367,8 +1367,7 @@ class Dir(Base): Looks up or creates a directory node named 'name' relative to this directory. """ - dir = self.fs.Dir(name, self, create) - return dir + return self.fs.Dir(name, self, create) def File(self, name): """ @@ -2172,16 +2171,14 @@ class File(Base): self._morph() def Entry(self, name): - """Create an entry node named 'name' relative to - the SConscript directory of this file.""" - cwd = self.cwd or self.fs._cwd - return cwd.Entry(name) + #"""Create an entry node named 'name' relative to + #the directory of this file.""" + return self.dir.Entry(name) def Dir(self, name, create=True): - """Create a directory node named 'name' relative to - the SConscript directory of this file.""" - cwd = self.cwd or self.fs._cwd - return cwd.Dir(name, create) + #"""Create a directory node named 'name' relative to + #the directory of this file.""" + return self.dir.Dir(name, create=create) def Dirs(self, pathlist): """Create a list of directories relative to the SConscript @@ -2189,10 +2186,9 @@ class File(Base): return map(lambda p, s=self: s.Dir(p), pathlist) def File(self, name): - """Create a file node named 'name' relative to - the SConscript directory of this file.""" - cwd = self.cwd or self.fs._cwd - return cwd.File(name) + #"""Create a file node named 'name' relative to + #the directory of this file.""" + return self.dir.File(name) #def generate_build_dict(self): # """Return an appropriate dictionary of values for building -- 2.26.2