[Scons-users] check for build
Philipp Kraus
philipp.kraus at flashpixx.de
Fri Jun 7 14:57:09 EDT 2013
Am 07.06.2013 um 20:28 schrieb Dirk Bächle:
> On 07.06.2013 19:45, Bill Deegan wrote:
>> Sounds like what you really want is a scanner to get the hash from the source for your download builder.
>> Not a change to your emitter..
>>
>
> Another approach would be to put the HTTP header text into a ValueNode, and then let the target (downloaded file) depend on it.
Both ideas are nice, but your idea sound a little bit better. My emitter creates the target filename eg
env.Download("a_target_name", "http://..../file.tar"), so the emitter changes the target name into file.tar, the builder create the access for download.
With an option I can use the target name, that is set in the function call or the name can be replaced by the emitter.
def __emitter( target, source, env ) :
# check source, read metainformation, create hash value, if hash value is equal to the value in the SCons database, we don't need to build anything
target[0].prepare()
if not env.get("URLDOWNLOAD_USEURLFILENAME", False) :
return target, source
try :
url = urlparse.urlparse( str(source[0]) )
except Exception, e :
raise SCons.Errors.StopError( e )
# get source meta information, create a hash value of the information and push it to the SCons database
return url.path.split("/")[-1], source
target & source are singles types, so I would like to create a structure like a "check for an existing target / source", so how can I replace the #
values with a correct code.
Thanks
Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20130607/73d4dcbc/attachment.htm
More information about the Scons-users
mailing list