[Scons-users] check target must be build / is up-to-date
Bill Deegan
bill at baddogconsulting.com
Thu Jun 20 19:25:48 EDT 2013
Phil,
I take it that you are removing the downloaded file with your extract logic
then?
-Bill
On Thu, Jun 20, 2013 at 4:14 PM, Philipp Kraus
<philipp.kraus at flashpixx.de>wrote:
> Sorry, a little more detail:
>
> My problem is that I use in my two builders (extract & download) something
> like this:
>
> x = env.Download(....)
> env.Extract("extractdir", x)
>
> but if the download target x is up-to-date, the builder does not create
> any file, because it is nothing to do, so
> the extract builder fails, because no file exists, so I need a check like
>
> x = env.Download(..)
> if fileexists(x) :
> env.Extract(x)
>
> on the else part everything is fine, so there is nothing to do. I have
> tested my download builder with the call, that
> if all is up-to-date the emitter returns a None type, but IMHO this is a
> bad style.
> I need a tip to do a correct result of the builder, if the target exists
> physical and only than I can call the extract builder.
> The problem is the difference between physical file and URL. The problem
> exists only if I use the download builder
> in a depend build structure
>
> Thanks
>
> Phil
>
>
>
>
> Am 21.06.2013 um 00:51 schrieb Bill Deegan:
>
> Phil,
>
> What's the do something if it must be built? And the not build action?
> Knowing that will help with how it might be done.
>
> You can add a postaction to the action that does this for the positive
> case, but not really sure how you'd do the negative?
>
> -Bill
>
>
>
> On Thu, Jun 20, 2013 at 3:21 PM, Philipp Kraus <philipp.kraus at flashpixx.de
> > wrote:
>
>> Hello,
>>
>> can I check if a target must be build again?
>> I have got something like
>>
>> x = env.Builder("test", [sources])
>> if x.must_build() :
>> do something if the target must be build
>> else :
>> do something if the target is up-to-date
>>
>> Thanks
>>
>> Phil
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> http://four.pairlist.net/mailman/listinfo/scons-users
>>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> http://four.pairlist.net/mailman/listinfo/scons-users
>
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> http://four.pairlist.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20130620/2247bc01/attachment-0001.htm
More information about the Scons-users
mailing list