summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-11-12 04:24:15 (GMT)
committerSteven Knight <knight@baldmt.com>2002-11-12 04:24:15 (GMT)
commit6a9cd3a308b6aa70d0fbaa7bb32e5a3c8fd32052 (patch)
tree4a34ebd34c3d15b05b322e099e4825c901e503b0 /src/engine
parent8dbe61168174137944a5bc55ea5a9ff389336376 (diff)
downloadSCons-6a9cd3a308b6aa70d0fbaa7bb32e5a3c8fd32052.zip
SCons-6a9cd3a308b6aa70d0fbaa7bb32e5a3c8fd32052.tar.gz
SCons-6a9cd3a308b6aa70d0fbaa7bb32e5a3c8fd32052.tar.bz2
Arrange for local copies of files in build/ so the Aegis build will continue to work.
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/Node/FS.py16
-rw-r--r--src/engine/SCons/Node/FSTests.py9
2 files changed, 20 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
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index 8f9f5e4..9e6e095 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -631,6 +631,15 @@ class FSTestCase(unittest.TestCase):
f1.prepare()
assert not os.path.exists(test.workpath("remove_me"))
+ e = fs.Entry('e_local')
+ assert not hasattr(e, '_local')
+ e.set_local()
+ assert e._local == 1
+ f = fs.File('e_local')
+ assert f._local == 1
+ f = fs.File('f_local')
+ assert f._local == 0
+
#XXX test current() for directories
#XXX test sconsign() for directories