forked from lix-project/lix
forceList: make pos mandatory
This commit is contained in:
parent
c3896e19d0
commit
3d2ad2b70b
|
@ -33,7 +33,7 @@ string resolveMirrorUrl(EvalState & state, string url)
|
||||||
auto mirrorList = vMirrors.attrs->find(state.symbols.create(mirrorName));
|
auto mirrorList = vMirrors.attrs->find(state.symbols.create(mirrorName));
|
||||||
if (mirrorList == vMirrors.attrs->end())
|
if (mirrorList == vMirrors.attrs->end())
|
||||||
throw Error("unknown mirror name '%s'", mirrorName);
|
throw Error("unknown mirror name '%s'", mirrorName);
|
||||||
state.forceList(*mirrorList->value);
|
state.forceList(*mirrorList->value, noPos);
|
||||||
|
|
||||||
if (mirrorList->value->listSize() < 1)
|
if (mirrorList->value->listSize() < 1)
|
||||||
throw Error("mirror URL '%s' did not expand to anything", url);
|
throw Error("mirror URL '%s' did not expand to anything", url);
|
||||||
|
@ -200,7 +200,7 @@ static int main_nix_prefetch_url(int argc, char * * argv)
|
||||||
|
|
||||||
/* Extract the URL. */
|
/* Extract the URL. */
|
||||||
auto & attr = v.attrs->need(state->symbols.create("urls"));
|
auto & attr = v.attrs->need(state->symbols.create("urls"));
|
||||||
state->forceList(*attr.value);
|
state->forceList(*attr.value, noPos);
|
||||||
if (attr.value->listSize() < 1)
|
if (attr.value->listSize() < 1)
|
||||||
throw Error("'urls' list is empty");
|
throw Error("'urls' list is empty");
|
||||||
url = state->forceString(*attr.value->listElems()[0]);
|
url = state->forceString(*attr.value->listElems()[0]);
|
||||||
|
|
Loading…
Reference in a new issue