diff options
Diffstat (limited to 'src/engine/SCons/Node/FS.py')
| -rw-r--r-- | src/engine/SCons/Node/FS.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index fac9627..3b0e6ca 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -45,15 +45,21 @@ import SCons.Warnings try: import os - file_link = os.link + _link = os.link except AttributeError: import shutil import stat - def file_link(src, dest): + def _link(src, dest): shutil.copy2(src, dest) st=os.stat(src) os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE) +def file_link(src, dest): + dir, file = os.path.split(dest) + if dir and not os.path.isdir(dir): + os.makedirs(dir) + _link(src, dest) + class ParentOfRoot: """ An instance of this class is used as the parent of the root of a @@ -735,7 +741,8 @@ class File(Entry): def _morph(self): """Turn a file system node into a File object.""" self.created = 0 - self._local = 0 + if not hasattr(self, '_local'): + self._local = 0 def root(self): return self.dir.root() @@ -861,8 +868,7 @@ class File(Entry): except OSError: pass self.__createDir() - file_link(src.abspath, - self.abspath) + file_link(src.abspath, self.abspath) self.created = 1 # Set our exists cache accordingly |
