aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/cat.cc4
-rw-r--r--src/nix/hash.cc2
-rw-r--r--src/nix/ls.cc2
-rw-r--r--src/nix/repl.cc8
-rw-r--r--src/nix/run.cc4
5 files changed, 10 insertions, 10 deletions
diff --git a/src/nix/cat.cc b/src/nix/cat.cc
index 851f90abd..4e14f50ed 100644
--- a/src/nix/cat.cc
+++ b/src/nix/cat.cc
@@ -13,9 +13,9 @@ struct MixCat : virtual Args
{
auto st = accessor->stat(path);
if (st.type == FSAccessor::Type::tMissing)
- throw Error(format("path '%1%' does not exist") % path);
+ throw Error("path '%1%' does not exist", path);
if (st.type != FSAccessor::Type::tRegular)
- throw Error(format("path '%1%' is not a regular file") % path);
+ throw Error("path '%1%' is not a regular file", path);
std::cout << accessor->readFile(path);
}
diff --git a/src/nix/hash.cc b/src/nix/hash.cc
index 0cc523f50..128708339 100644
--- a/src/nix/hash.cc
+++ b/src/nix/hash.cc
@@ -126,7 +126,7 @@ static int compatNixHash(int argc, char * * argv)
string s = getArg(*arg, arg, end);
ht = parseHashType(s);
if (ht == htUnknown)
- throw UsageError(format("unknown hash type '%1%'") % s);
+ throw UsageError("unknown hash type '%1%'", s);
}
else if (*arg == "--to-base16") op = opTo16;
else if (*arg == "--to-base32") op = opTo32;
diff --git a/src/nix/ls.cc b/src/nix/ls.cc
index 3ef1f2750..5d55bd4d5 100644
--- a/src/nix/ls.cc
+++ b/src/nix/ls.cc
@@ -65,7 +65,7 @@ struct MixLs : virtual Args, MixJSON
auto st = accessor->stat(path);
if (st.type == FSAccessor::Type::tMissing)
- throw Error(format("path '%1%' does not exist") % path);
+ throw Error("path '%1%' does not exist", path);
doPath(st, path,
st.type == FSAccessor::Type::tDirectory ? "." : std::string(baseNameOf(path)),
showDirectory);
diff --git a/src/nix/repl.cc b/src/nix/repl.cc
index 27727bd25..c770fd4a4 100644
--- a/src/nix/repl.cc
+++ b/src/nix/repl.cc
@@ -252,12 +252,12 @@ void NixRepl::mainLoop(const std::vector<std::string> & files)
// input without clearing the input so far.
continue;
} else {
- printMsg(lvlError, format(error + "%1%%2%") % (settings.showTrace ? e.prefix() : "") % e.msg());
+ printMsg(lvlError, error + "%1%%2%", (settings.showTrace ? e.prefix() : ""), e.msg());
}
} catch (Error & e) {
- printMsg(lvlError, format(error + "%1%%2%") % (settings.showTrace ? e.prefix() : "") % e.msg());
+ printMsg(lvlError, error + "%1%%2%", (settings.showTrace ? e.prefix() : ""), e.msg());
} catch (Interrupted & e) {
- printMsg(lvlError, format(error + "%1%%2%") % (settings.showTrace ? e.prefix() : "") % e.msg());
+ printMsg(lvlError, error + "%1%%2%", (settings.showTrace ? e.prefix() : ""), e.msg());
}
// We handled the current input fully, so we should clear it
@@ -546,7 +546,7 @@ bool NixRepl::processLine(string line)
return false;
else if (command != "")
- throw Error(format("unknown command '%1%'") % command);
+ throw Error("unknown command '%1%'", command);
else {
size_t p = line.find('=');
diff --git a/src/nix/run.cc b/src/nix/run.cc
index 8e30264c0..d790979a4 100644
--- a/src/nix/run.cc
+++ b/src/nix/run.cc
@@ -197,10 +197,10 @@ void chrootHelper(int argc, char * * argv)
Finally freeCwd([&]() { free(cwd); });
if (chroot(tmpDir.c_str()) == -1)
- throw SysError(format("chrooting into '%s'") % tmpDir);
+ throw SysError("chrooting into '%s'", tmpDir);
if (chdir(cwd) == -1)
- throw SysError(format("chdir to '%s' in chroot") % cwd);
+ throw SysError("chdir to '%s' in chroot", cwd);
} else
if (mount(realStoreDir.c_str(), storeDir.c_str(), "", MS_BIND, 0) == -1)
throw SysError("mounting '%s' on '%s'", realStoreDir, storeDir);