Merge remote-tracking branch 'origin/master' into coerce-string

This commit is contained in:
Guillaume Maudoux
2022-04-29 00:12:25 +02:00
170 changed files with 4010 additions and 2203 deletions
+6 -4
View File
@@ -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"));