diff options
author | Steven Knight <knight@baldmt.com> | 2003-02-12 03:52:10 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-02-12 03:52:10 (GMT) |
commit | 5bbe45c7286f8e9e6d0139e611e0763681c2dd45 (patch) | |
tree | 0b4258916ddc551ee6ee345ba2943e52f9bab38f /src/engine/SCons/Defaults.py | |
parent | a2960be7a116f6e085a1072123976b1b31b09f1b (diff) | |
download | SCons-5bbe45c7286f8e9e6d0139e611e0763681c2dd45.zip SCons-5bbe45c7286f8e9e6d0139e611e0763681c2dd45.tar.gz SCons-5bbe45c7286f8e9e6d0139e611e0763681c2dd45.tar.bz2 |
Make the Install() method copy files (by default).
Diffstat (limited to 'src/engine/SCons/Defaults.py')
-rw-r--r-- | src/engine/SCons/Defaults.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py index 6a3659d..f0c2163 100644 --- a/src/engine/SCons/Defaults.py +++ b/src/engine/SCons/Defaults.py @@ -37,8 +37,10 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os -import string import os.path +import shutil +import stat +import string import SCons.Action import SCons.Builder @@ -183,6 +185,14 @@ Program = SCons.Builder.Builder(action=[ StaticCheck, '$LINKCOM' ], src_builder='Object', scanner = ProgScan) +def copyFunc(dest, source, env): + """Install a source file into a destination by copying it (and its + permission/mode bits).""" + shutil.copy2(source, dest) + st = os.stat(source) + os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE) + return 0 + def _concat(prefix, list, suffix, locals, globals, f=lambda x: x): """Creates a new list from 'list' by first interpolating each element in the list using 'locals' and 'globals' and then calling f @@ -257,6 +267,7 @@ ConstructionEnvironment = { 'PSPREFIX' : '', 'PSSUFFIX' : '.ps', 'ENV' : {}, + 'INSTALL' : copyFunc, '_concat' : _concat, '_stripixes' : _stripixes, '_LIBFLAGS' : '${_concat(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, locals(), globals())}', |