about summary refs log tree commit diff
path: root/src/libstore/download.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-07-26T19·16+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-07-26T19·16+0200
commit06bbfb6004942bfcddd930e746ee7a2bfe5c3872 (patch)
tree25395e3e0da92eb914abf4f59f33027269a28224 /src/libstore/download.hh
parentee3032e4de439b481ce1a4bc7fd8d71ea6ed2c94 (diff)
builtins.{fetchurl,fetchTarball}: Support a sha256 attribute
Also, allow builtins.{fetchurl,fetchTarball} in restricted mode if a
hash is specified.
Diffstat (limited to 'src/libstore/download.hh')
-rw-r--r--src/libstore/download.hh4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstore/download.hh b/src/libstore/download.hh
index eb2b76678a..efddc55281 100644
--- a/src/libstore/download.hh
+++ b/src/libstore/download.hh
@@ -1,6 +1,7 @@
 #pragma once
 
 #include "types.hh"
+#include "hash.hh"
 
 #include <string>
 
@@ -27,7 +28,8 @@ struct Downloader
 {
     virtual DownloadResult download(string url, const DownloadOptions & options) = 0;
 
-    Path downloadCached(ref<Store> store, const string & url, bool unpack);
+    Path downloadCached(ref<Store> store, const string & url, bool unpack,
+        const Hash & expectedHash = Hash());
 
     enum Error { NotFound, Forbidden, Misc };
 };