[Scons-users] Can't get Delete Action to delete a directory.

William Deegan bill at baddogconsulting.com
Wed Feb 6 23:13:13 EST 2013


Matt,


On 02/06/2013 04:13 PM, M Busche wrote:

> I was still hoping for some help with this.

>

> Is my Ubuntu command line capture incomprehensible? The trace below

> shows how a 2-line SConstruct file will remove a simple file, but not

> a directory. I don't get it.


Likely the issue is the source you specify for the command.
It's always up to date, thus:

$ scons -Q tgt=bar
scons: `.' is up to date.

t = Command(tgt, [], [Delete("$TARGET")])

Perhaps try:

t = Command(tgt,Dir('$TARGET'),[Delete("$TARGET"))

Though this logic is a bit curious, what are you trying to do?
Perhaps you really want to use Execute()?

-Bill



>

> Thanks for any insight you can offer into this unexpected behavior.

>

> Matt

>

>

> ------------------------------------------------------------------------

> *From:* M Busche <spammymatt94 at yahoo.com>

> *To:* "scons-users at scons.org" <scons-users at scons.org>

> *Sent:* Friday, February 1, 2013 10:30 PM

> *Subject:* [Scons-users] Can't get Delete Action to delete a directory.

>

> Here's my very simple test:

>

> $ ls -a

> . .. SConstruct

> $ cat SConstruct

> tgt = ARGUMENTS.get('tgt', '')

> t = Command(tgt, [], [Delete("$TARGET")])

> $ touch foo

> $ ls -a

> . .. foo SConstruct

> $ scons -Q tgt=foo

> Delete("foo")

> $ ls -a

> . .. .sconsign.dblite SConstruct

> $ mkdir bar

> $ scons -Q tgt=bar

> scons: `.' is up to date.

> $ ls -a

> . .. bar .sconsign.dblite SConstruct

> $

>

> I must be missing something. Can someone explain why Delete won't

> delete directory bar when the man page clearly states that the Delete

> factory works for both files and directory trees?

>

> Thanks,

> Matt

>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20130206/19a4d298/attachment.htm>


More information about the Scons-users mailing list