X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senfscons%2FInstallSubdir.py;fp=senfscons%2FInstallSubdir.py;h=d76a51274ec7d0a7a08b1e5c8334e50da5e21e52;hb=b1f9349b1f3521d58cbef52ead0f2e5303a58c9e;hp=0000000000000000000000000000000000000000;hpb=87204d50de0c429f265aec817bc9efd9af816082;p=senf.git diff --git a/senfscons/InstallSubdir.py b/senfscons/InstallSubdir.py new file mode 100644 index 0000000..d76a512 --- /dev/null +++ b/senfscons/InstallSubdir.py @@ -0,0 +1,17 @@ +import SCons.Errors + +def InstallSubdir(env, target=None, source=None, base='#', **kw): + builds = [] + target = env.arg2nodes(target, env.fs.Dir) + if len(target) != 1: + raise SCons.Errors.UserError, "Need exactly one target for InstallWithDir()" + base = env.arg2nodes(base, env.fs.Dir)[0] + for src in env.arg2nodes(source, env.fs.Entry): + builds.extend(apply(env.Install, (target[0].Dir(src.dir.get_path(base)), src), kw)) + return builds + +def generate(env): + env['BUILDERS']['InstallSubdir'] = InstallSubdir + +def exists(env): + return 1