builtins.fetch{url,tarball}: Allow name attribute
This commit is contained in:
parent
eff80419c7
commit
d52d391164
3 changed files with 13 additions and 9 deletions
|
|
@ -243,13 +243,14 @@ ref<Downloader> makeDownloader()
|
|||
return make_ref<CurlDownloader>();
|
||||
}
|
||||
|
||||
Path Downloader::downloadCached(ref<Store> store, const string & url_, bool unpack, const Hash & expectedHash)
|
||||
Path Downloader::downloadCached(ref<Store> store, const string & url_, bool unpack, string name, const Hash & expectedHash)
|
||||
{
|
||||
auto url = resolveUri(url_);
|
||||
|
||||
string name;
|
||||
auto p = url.rfind('/');
|
||||
if (p != string::npos) name = string(url, p + 1);
|
||||
if (name == "") {
|
||||
auto p = url.rfind('/');
|
||||
if (p != string::npos) name = string(url, p + 1);
|
||||
}
|
||||
|
||||
Path expectedStorePath;
|
||||
if (expectedHash) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue