[Scons-users] turning off directory creation?

Robert Zeigler robert.zeigler at gmail.com
Tue Apr 30 09:54:47 EDT 2013


Ok. Thanks for the multi-command tip! I didn't know Command could take a list of commands.

Robert

On Apr 30, 2013, at 4/308:52 AM , Gary Oberbrunner <garyo at oberbrunner.com> wrote:


>

>

>

> On Tue, Apr 30, 2013 at 9:36 AM, Robert Zeigler <robert.zeigler at gmail.com> wrote:

> The real command creates the directory structure (and the target). The problem is the real command, unfortunately, depends on at least part of the directory structure NOT existing when it begins to run. The real command looks more like:

>

> Command(["a/b/c.txt"],["e/f/g.txt"], "buildc $SOURCE")

>

> And, unfortunately, "buildc" needs to start with a clean state, i.e. "a" can't exist when buildc runs, or else buildc will fail.

> But scons auto-creates a/b before ever running "buildc $SOURCE".

>

> As I said, long-term, reworking "buildc" to allow for pre-existing directory structures is the "right" solution; and my current dirty hack is along the lines of:

>

> Command(["a/b/c.txt"],["e/f/g.txt"], "rm -rf a && buildc $SOURCE")

>

> I'm just wondering if there is a way to make scons NOT create a/b before calling buildc.

>

> Got it. There's no public way to do this in SCons today. You'd have to patch SCons itself, and it would probably get dirty pretty quickly. Your hack is actually pretty decent. If you want it slightly cleaner you could use a list of two commands:

> cmds = ['rm -rf $TARGET.dir', 'buildc $SOURCE']

> or something like that.

>

> --

> Gary

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users




More information about the Scons-users mailing list