diff options
| author | Steven Knight <knight@baldmt.com> | 2001-12-20 23:23:46 (GMT) |
|---|---|---|
| committer | Steven Knight <knight@baldmt.com> | 2001-12-20 23:23:46 (GMT) |
| commit | 754c465fbd31d4c9518e0bbdc20ee5021934aee9 (patch) | |
| tree | 22f850e54038df3399403d4653d3650a99660e32 /src/engine/SCons/Node | |
| parent | bce5d5cd1f391ae5adfb90f3d936cd12516c1d5f (diff) | |
| download | SCons-754c465fbd31d4c9518e0bbdc20ee5021934aee9.zip SCons-754c465fbd31d4c9518e0bbdc20ee5021934aee9.tar.gz SCons-754c465fbd31d4c9518e0bbdc20ee5021934aee9.tar.bz2 | |
Bug fixes: BuildDir() non-writable files, and CPPPATH/LIBPATH variable subsitution (from Charles Crain).
Diffstat (limited to 'src/engine/SCons/Node')
| -rw-r--r-- | src/engine/SCons/Node/FS.py | 2 | ||||
| -rw-r--r-- | src/engine/SCons/Node/FSTests.py | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 5cc06ac..ee5deaa 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -50,7 +50,7 @@ except AttributeError: def file_link(src, dest): shutil.copyfile(src, dest) st=os.stat(src) - os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE])) + os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE) class PathName: """This is a string like object with limited capabilities (i.e., diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index f97627e..b166be1 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -31,6 +31,7 @@ import unittest import SCons.Node.FS from TestCmd import TestCmd from SCons.Errors import UserError +import stat built_it = None @@ -85,6 +86,18 @@ class BuildDirTestCase(unittest.TestCase): assert f1.srcpath == 'src/test1', f1.srcpath assert f2.srcpath == 'src/test1', f2.srcpath + # Test to see if file_link() works... + test=TestCmd(workdir='') + test.subdir('src','build') + test.write('src/foo', 'foo\n') + os.chmod(test.workpath('src/foo'), stat.S_IRUSR) + SCons.Node.FS.file_link(test.workpath('src/foo'), + test.workpath('build/foo')) + os.chmod(test.workpath('src/foo'), stat.S_IRUSR | stat.S_IWRITE) + st=os.stat(test.workpath('build/foo')) + assert (stat.S_IMODE(st[stat.ST_MODE]) & stat.S_IWRITE), \ + stat.S_IMODE(st[stat.ST_MODE]) + exc_caught = 0 try: fs = SCons.Node.FS.FS() |
