0

Scons Copy builder doesn't do anything when the path I want to copy to points outside the project directory. Is there any way to get it to actually do it? Below is more or less the test case:

p4_dir = '../../../documents'

def prefix_dir(files, *directory):
    if not type(directory) is tuple:
        directory = (directory,)
    return [os.path.realpath(
        os.path.join(*(directory + (f,))).replace('\\', '/')) for f in files]

def p4doc():
    for x, y in zip(prefix_dir(p4_goodies, Dir('.').abspath, p4_dir), p4_goodies):
        print 'copying to: %s from: %s' % (x, y)
        Command(x, y, [Delete("$TARGET"), Copy("$TARGET", "$SOURCE")])

p4doc()

Besides, when it copies, it doesn't really copy the files it's told to copy, it takes all the targets given to the builder, which calls this action... You can substitute $TARGET and $SOURCE in the Copy command with any string. Given it doesn't have double dots in it, all builder's sources will be copied. Now this isn't just wrong... this is stupid by design :|

1 Answers1

0

You could try the Install() builder. The files it copies/installs should be SCons targets and if they're not, they probably wont be copied.

Brady
  • 10,207
  • 2
  • 20
  • 59
  • @wvxvw, well it all stems from 2 SCons concepts: its designed to only work on dirs/files in the same dir or a subdir of where the SConstruct is, and it typically only works on SCons target files. – Brady May 22 '13 at 12:50