Merge remote-tracking branch 'origin/master' into coerce-string
This commit is contained in:
+6
-4
@@ -199,11 +199,13 @@ static int main_nix_prefetch_url(int argc, char * * argv)
|
||||
state->forceAttrs(v, noPos, "while evaluating the source attribute to prefetch");
|
||||
|
||||
/* Extract the URL. */
|
||||
auto & attr = v.attrs->need(state->symbols.create("urls"));
|
||||
state->forceList(*attr.value, noPos, "while evaluating the urls to prefetch");
|
||||
if (attr.value->listSize() < 1)
|
||||
auto * attr = v.attrs->get(state->symbols.create("urls"));
|
||||
if (!attr)
|
||||
throw Error("attribute 'urls' missing");
|
||||
state->forceList(*attr->value, noPos, "while evaluating the urls to prefetch");
|
||||
if (attr->value->listSize() < 1)
|
||||
throw Error("'urls' list is empty");
|
||||
url = state->forceString(*attr.value->listElems()[0], noPos, "while evaluating the first url from the urls list");
|
||||
url = state->forceString(*attr->value->listElems()[0], noPos, "while evaluating the first url from the urls list");
|
||||
|
||||
/* Extract the hash mode. */
|
||||
auto attr2 = v.attrs->get(state->symbols.create("outputHashMode"));
|
||||
|
||||
Reference in New Issue
Block a user