1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

Merge branch 'enum-class' into no-hash-type-unknown

This commit is contained in:
John Ericson 2020-06-18 21:58:27 +00:00
commit bbbf3602a3
151 changed files with 2757 additions and 1788 deletions

View file

@ -8,7 +8,7 @@
#include "attr-path.hh"
#include "finally.hh"
#include "../nix/legacy.hh"
#include "../nix/progress-bar.hh"
#include "progress-bar.hh"
#include "tarfile.hh"
#include <iostream>
@ -37,11 +37,11 @@ string resolveMirrorUri(EvalState & state, string uri)
auto mirrorList = vMirrors.attrs->find(state.symbols.create(mirrorName));
if (mirrorList == vMirrors.attrs->end())
throw Error(format("unknown mirror name '%1%'") % mirrorName);
throw Error("unknown mirror name '%1%'", mirrorName);
state.forceList(*mirrorList->value);
if (mirrorList->value->listSize() < 1)
throw Error(format("mirror URI '%1%' did not expand to anything") % uri);
throw Error("mirror URI '%1%' did not expand to anything", uri);
string mirror = state.forceString(*mirrorList->value->listElems()[0]);
return mirror + (hasSuffix(mirror, "/") ? "" : "/") + string(s, p + 1);
@ -149,7 +149,7 @@ static int _main(int argc, char * * argv)
if (name.empty())
name = baseNameOf(uri);
if (name.empty())
throw Error(format("cannot figure out file name for '%1%'") % uri);
throw Error("cannot figure out file name for '%1%'", uri);
/* If an expected hash is given, the file may already exist in
the store. */
@ -205,7 +205,7 @@ static int _main(int argc, char * * argv)
hash = unpack ? hashPath(ht, tmpFile).first : hashFile(ht, tmpFile);
if (expectedHash != Hash(ht) && expectedHash != hash)
throw Error(format("hash mismatch for '%1%'") % uri);
throw Error("hash mismatch for '%1%'", uri);
const auto recursive = unpack ? FileIngestionMethod::Recursive : FileIngestionMethod::Flat;