Commit 1046b48f authored by Julien Muchembled's avatar Julien Muchembled

default: make 'self.download' use url&md5sum options if called without url

parent a1e0d26e
...@@ -27,7 +27,7 @@ Example that installs software:: ...@@ -27,7 +27,7 @@ Example that installs software::
url = http://host/path/foo.tar.gz url = http://host/path/foo.tar.gz
md5sum = ... md5sum = ...
install = install =
extract_dir = self.extract(self.download(options['url'], options['md5sum'])) extract_dir = self.extract(self.download())
self.copyTree(guessworkdir(extract_dir), location) self.copyTree(guessworkdir(extract_dir), location)
${:update} ${:update}
update = update =
......
...@@ -143,6 +143,8 @@ class Script(EnvironMixin): ...@@ -143,6 +143,8 @@ class Script(EnvironMixin):
'\n '.join(promise_problem_list)) '\n '.join(promise_problem_list))
def download(self, *args, **kw): def download(self, *args, **kw):
if not (args or 'url' in kw):
args = self.options['url'], self.options.get('md5sum') or None
path, is_temp = zc.buildout.download.Download(self.buildout['buildout'], path, is_temp = zc.buildout.download.Download(self.buildout['buildout'],
hash_name=True)(*args, **kw) hash_name=True)(*args, **kw)
if is_temp: if is_temp:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment