[Scons-users] How to _decide_ the target change by a given MD5SUM.

Xiongfei Guo xfguo at xfguo.org
Sun Jan 18 01:00:24 EST 2015


Hi,

I am writing a builder that can download the file from internet by a 
given URL. I think [1] is a very good reference for me, but my 
requirement is a little bit different, that is, the _URLDownload_ 
builder showed in [1] is

     env.URLDownload( "<filename>", "<download url>" )

each time we run `scons`, it will get the "<download url>" HTTP header 
then check it's Length & Last-Modified.

but I want to give a MD5SUM value to the builder that if the _target_ 
file is exist and its MD5SUM is equal to the given one, then *do 
nothing*. Like,

     env.URLDownload( "<filename>", "<download url>", MD5SUM = 
'123456789abcdef' )

So, I want to get some help that how to let the builder check whether 
the _target_ is changed by a given function/method.

Thanks & BR.

Alex Guo
----

[1] http://www.scons.org/wiki/DownloadUnpack


More information about the Scons-users mailing list