[Scons-users] Starting with a clean installation directory
Pico Geyer
picogeyer at gmail.com
Tue Oct 22 16:19:34 EDT 2013
>
> Hi Pico,
>
Hi Marc,
>
> I think the error you saw with the AddPreAction approach arises because the
> install_dir directory has disappeared. My understanding is that SCons
> expects all target directories to exists after it reads all the
> SConstruct/SConscript files (it creates the target dirs as needed as it
> scans
> those files). So when it executes any Install() builders, all it does is
> copy files into existing directories.
>
Yes, I think you're right there.
Scons certainly doesn't like it when I remove a directory it expects to be
there.
> So your AddPreAction() approach should work if you take care to not delete
> the directory itself (and any sub-directories), or re-create it (them)
> after
> deleting. Maybe something like:
>
> env.AddPreAction(t_all_install, "find ../install_dir -type f -delete")
>
Ah, yes, I did eventually notice this as well. I started doing this:
env.AddPreAction(t_all_install,
[Delete('../install_dir'),Mkdir('../install_dir')])
But I think my version might fail at some other point, so your solution is
nicer.
Thanks!
Pico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20131022/0e139db0/attachment.htm
More information about the Scons-users
mailing list