refactor(tvix): remove all 'using namespace' from nix command
clang-tidy: google-build-using-namespace Change-Id: I07ea10b03a6d9582c0508747698038f7106e8f63 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2181 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
This commit is contained in:
parent
363dbeae95
commit
516c046ed9
22 changed files with 96 additions and 90 deletions
6
third_party/nix/src/nix/add-to-store.cc
vendored
6
third_party/nix/src/nix/add-to-store.cc
vendored
|
@ -3,8 +3,7 @@
|
|||
#include "libutil/archive.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct CmdAddToStore final : MixDryRun, StoreCommand {
|
||||
Path path;
|
||||
std::optional<std::string> namePart;
|
||||
|
@ -47,5 +46,6 @@ struct CmdAddToStore final : MixDryRun, StoreCommand {
|
|||
std::cout << fmt("%s\n", info.path);
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdAddToStore>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdAddToStore>());
|
||||
|
|
6
third_party/nix/src/nix/build.cc
vendored
6
third_party/nix/src/nix/build.cc
vendored
|
@ -3,8 +3,7 @@
|
|||
#include "libstore/store-api.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct CmdBuild final : MixDryRun, InstallablesCommand {
|
||||
Path outLink = "result";
|
||||
|
||||
|
@ -64,5 +63,6 @@ struct CmdBuild final : MixDryRun, InstallablesCommand {
|
|||
}
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdBuild>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdBuild>());
|
||||
|
|
8
third_party/nix/src/nix/cat.cc
vendored
8
third_party/nix/src/nix/cat.cc
vendored
|
@ -3,8 +3,7 @@
|
|||
#include "libstore/store-api.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct MixCat : virtual Args {
|
||||
std::string path;
|
||||
|
||||
|
@ -51,6 +50,7 @@ struct CmdCatNar final : StoreCommand, MixCat {
|
|||
cat(makeNarAccessor(make_ref<std::string>(readFile(narPath))));
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdCatStore>());
|
||||
static RegisterCommand r2(make_ref<CmdCatNar>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdCatStore>());
|
||||
static nix::RegisterCommand r2(nix::make_ref<nix::CmdCatNar>());
|
||||
|
|
6
third_party/nix/src/nix/copy.cc
vendored
6
third_party/nix/src/nix/copy.cc
vendored
|
@ -6,8 +6,7 @@
|
|||
#include "libutil/thread-pool.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct CmdCopy final : StorePathsCommand {
|
||||
std::string srcUri, dstUri;
|
||||
|
||||
|
@ -82,5 +81,6 @@ struct CmdCopy final : StorePathsCommand {
|
|||
NoRepair, checkSigs, substitute);
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdCopy>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdCopy>());
|
||||
|
|
8
third_party/nix/src/nix/doctor.cc
vendored
8
third_party/nix/src/nix/doctor.cc
vendored
|
@ -8,9 +8,8 @@
|
|||
#include "libstore/worker-protocol.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
std::string formatProtocol(unsigned int proto) {
|
||||
namespace nix {
|
||||
static std::string formatProtocol(unsigned int proto) {
|
||||
if (proto != 0u) {
|
||||
auto major = GET_PROTOCOL_MAJOR(proto) >> 8;
|
||||
auto minor = GET_PROTOCOL_MINOR(proto);
|
||||
|
@ -138,5 +137,6 @@ struct CmdDoctor final : StoreCommand {
|
|||
return true;
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdDoctor>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdDoctor>());
|
||||
|
|
6
third_party/nix/src/nix/dump-path.cc
vendored
6
third_party/nix/src/nix/dump-path.cc
vendored
|
@ -1,8 +1,7 @@
|
|||
#include "libstore/store-api.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct CmdDumpPath final : StorePathCommand {
|
||||
std::string name() override { return "dump-path"; }
|
||||
|
||||
|
@ -24,5 +23,6 @@ struct CmdDumpPath final : StorePathCommand {
|
|||
sink.flush();
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdDumpPath>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdDumpPath>());
|
||||
|
|
6
third_party/nix/src/nix/edit.cc
vendored
6
third_party/nix/src/nix/edit.cc
vendored
|
@ -7,8 +7,7 @@
|
|||
#include "libmain/shared.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct CmdEdit final : InstallableCommand {
|
||||
std::string name() override { return "edit"; }
|
||||
|
||||
|
@ -71,5 +70,6 @@ struct CmdEdit final : InstallableCommand {
|
|||
throw SysError("cannot run editor '%s'", editor);
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdEdit>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdEdit>());
|
||||
|
|
6
third_party/nix/src/nix/eval.cc
vendored
6
third_party/nix/src/nix/eval.cc
vendored
|
@ -7,8 +7,7 @@
|
|||
#include "libutil/json.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct CmdEval final : MixJSON, InstallableCommand {
|
||||
bool raw = false;
|
||||
|
||||
|
@ -52,5 +51,6 @@ struct CmdEval final : MixJSON, InstallableCommand {
|
|||
}
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdEval>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdEval>());
|
||||
|
|
4
third_party/nix/src/nix/hash.cc
vendored
4
third_party/nix/src/nix/hash.cc
vendored
|
@ -4,8 +4,7 @@
|
|||
#include "nix/command.hh"
|
||||
#include "nix/legacy.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct CmdHash final : Command {
|
||||
enum Mode { mFile, mPath };
|
||||
Mode mode;
|
||||
|
@ -150,3 +149,4 @@ static int compatNixHash(int argc, char** argv) {
|
|||
}
|
||||
|
||||
static RegisterLegacyCommand s1("nix-hash", compatNixHash);
|
||||
} // namespace nix
|
||||
|
|
6
third_party/nix/src/nix/log.cc
vendored
6
third_party/nix/src/nix/log.cc
vendored
|
@ -5,8 +5,7 @@
|
|||
#include "libstore/store-api.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct CmdLog final : InstallableCommand {
|
||||
CmdLog() = default;
|
||||
|
||||
|
@ -59,5 +58,6 @@ struct CmdLog final : InstallableCommand {
|
|||
throw Error("build log of '%s' is not available", installable->what());
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdLog>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdLog>());
|
||||
|
|
8
third_party/nix/src/nix/ls.cc
vendored
8
third_party/nix/src/nix/ls.cc
vendored
|
@ -5,8 +5,7 @@
|
|||
#include "libutil/json.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct MixLs : virtual Args, MixJSON {
|
||||
std::string path;
|
||||
|
||||
|
@ -132,6 +131,7 @@ struct CmdLsNar final : Command, MixLs {
|
|||
list(makeNarAccessor(make_ref<std::string>(readFile(narPath, true))));
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdLsStore>());
|
||||
static RegisterCommand r2(make_ref<CmdLsNar>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdLsStore>());
|
||||
static nix::RegisterCommand r2(nix::make_ref<nix::CmdLsNar>());
|
||||
|
|
6
third_party/nix/src/nix/optimise-store.cc
vendored
6
third_party/nix/src/nix/optimise-store.cc
vendored
|
@ -4,8 +4,7 @@
|
|||
#include "libstore/store-api.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct CmdOptimiseStore final : StoreCommand {
|
||||
CmdOptimiseStore() = default;
|
||||
|
||||
|
@ -23,5 +22,6 @@ struct CmdOptimiseStore final : StoreCommand {
|
|||
|
||||
void run(ref<Store> store) override { store->optimiseStore(); }
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdOptimiseStore>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdOptimiseStore>());
|
||||
|
|
6
third_party/nix/src/nix/path-info.cc
vendored
6
third_party/nix/src/nix/path-info.cc
vendored
|
@ -7,8 +7,7 @@
|
|||
#include "libutil/json.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct CmdPathInfo final : StorePathsCommand, MixJSON {
|
||||
bool showSize = false;
|
||||
bool showClosureSize = false;
|
||||
|
@ -129,5 +128,6 @@ struct CmdPathInfo final : StorePathsCommand, MixJSON {
|
|||
}
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdPathInfo>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdPathInfo>());
|
||||
|
|
6
third_party/nix/src/nix/ping-store.cc
vendored
6
third_party/nix/src/nix/ping-store.cc
vendored
|
@ -2,8 +2,7 @@
|
|||
#include "libstore/store-api.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct CmdPingStore final : StoreCommand {
|
||||
std::string name() override { return "ping-store"; }
|
||||
|
||||
|
@ -21,5 +20,6 @@ struct CmdPingStore final : StoreCommand {
|
|||
|
||||
void run(ref<Store> store) override { store->connect(); }
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdPingStore>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdPingStore>());
|
||||
|
|
51
third_party/nix/src/nix/run.cc
vendored
51
third_party/nix/src/nix/run.cc
vendored
|
@ -13,10 +13,10 @@
|
|||
#include "libutil/finally.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
// note: exported in header file
|
||||
std::string chrootHelperName = "__run_in_chroot";
|
||||
|
||||
namespace nix {
|
||||
struct CmdRun final : InstallablesCommand {
|
||||
std::vector<std::string> command = {"bash"};
|
||||
StringSet keep, unset;
|
||||
|
@ -187,13 +187,14 @@ struct CmdRun final : InstallablesCommand {
|
|||
};
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdRun>());
|
||||
} // namespace nix
|
||||
|
||||
void chrootHelper(int argc, char** argv) {
|
||||
int p = 1;
|
||||
std::string storeDir = argv[p++];
|
||||
std::string realStoreDir = argv[p++];
|
||||
std::string cmd = argv[p++];
|
||||
Strings args;
|
||||
nix::Strings args;
|
||||
while (p < argc) {
|
||||
args.push_back(argv[p++]);
|
||||
}
|
||||
|
@ -206,7 +207,7 @@ void chrootHelper(int argc, char** argv) {
|
|||
/* Try with just CLONE_NEWNS in case user namespaces are
|
||||
specifically disabled. */
|
||||
if (unshare(CLONE_NEWNS) == -1) {
|
||||
throw SysError("setting up a private mount namespace");
|
||||
throw nix::SysError("setting up a private mount namespace");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -217,65 +218,65 @@ void chrootHelper(int argc, char** argv) {
|
|||
but that doesn't work in a user namespace yet (Ubuntu has a
|
||||
patch for this:
|
||||
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1478578). */
|
||||
if (!pathExists(storeDir)) {
|
||||
if (!nix::pathExists(storeDir)) {
|
||||
// FIXME: Use overlayfs?
|
||||
|
||||
Path tmpDir = createTempDir();
|
||||
nix::Path tmpDir = nix::createTempDir();
|
||||
|
||||
createDirs(tmpDir + storeDir);
|
||||
nix::createDirs(tmpDir + storeDir);
|
||||
|
||||
if (mount(realStoreDir.c_str(), (tmpDir + storeDir).c_str(), "", MS_BIND,
|
||||
nullptr) == -1) {
|
||||
throw SysError("mounting '%s' on '%s'", realStoreDir, storeDir);
|
||||
throw nix::SysError("mounting '%s' on '%s'", realStoreDir, storeDir);
|
||||
}
|
||||
|
||||
for (const auto& entry : readDirectory("/")) {
|
||||
for (const auto& entry : nix::readDirectory("/")) {
|
||||
auto src = "/" + entry.name;
|
||||
auto st = lstat(src);
|
||||
auto st = nix::lstat(src);
|
||||
if (!S_ISDIR(st.st_mode)) {
|
||||
continue;
|
||||
}
|
||||
Path dst = tmpDir + "/" + entry.name;
|
||||
if (pathExists(dst)) {
|
||||
nix::Path dst = tmpDir + "/" + entry.name;
|
||||
if (nix::pathExists(dst)) {
|
||||
continue;
|
||||
}
|
||||
if (mkdir(dst.c_str(), 0700) == -1) {
|
||||
throw SysError("creating directory '%s'", dst);
|
||||
throw nix::SysError("creating directory '%s'", dst);
|
||||
}
|
||||
if (mount(src.c_str(), dst.c_str(), "", MS_BIND | MS_REC, nullptr) ==
|
||||
-1) {
|
||||
throw SysError("mounting '%s' on '%s'", src, dst);
|
||||
throw nix::SysError("mounting '%s' on '%s'", src, dst);
|
||||
}
|
||||
}
|
||||
|
||||
char* cwd = getcwd(nullptr, 0);
|
||||
if (cwd == nullptr) {
|
||||
throw SysError("getting current directory");
|
||||
throw nix::SysError("getting current directory");
|
||||
}
|
||||
Finally freeCwd([&]() { free(cwd); });
|
||||
::Finally freeCwd([&]() { free(cwd); });
|
||||
|
||||
if (chroot(tmpDir.c_str()) == -1) {
|
||||
throw SysError(format("chrooting into '%s'") % tmpDir);
|
||||
throw nix::SysError(nix::format("chrooting into '%s'") % tmpDir);
|
||||
}
|
||||
|
||||
if (chdir(cwd) == -1) {
|
||||
throw SysError(format("chdir to '%s' in chroot") % cwd);
|
||||
throw nix::SysError(nix::format("chdir to '%s' in chroot") % cwd);
|
||||
}
|
||||
} else if (mount(realStoreDir.c_str(), storeDir.c_str(), "", MS_BIND,
|
||||
nullptr) == -1) {
|
||||
throw SysError("mounting '%s' on '%s'", realStoreDir, storeDir);
|
||||
throw nix::SysError("mounting '%s' on '%s'", realStoreDir, storeDir);
|
||||
}
|
||||
|
||||
writeFile("/proc/self/setgroups", "deny");
|
||||
writeFile("/proc/self/uid_map", fmt("%d %d %d", uid, uid, 1));
|
||||
writeFile("/proc/self/gid_map", fmt("%d %d %d", gid, gid, 1));
|
||||
nix::writeFile("/proc/self/setgroups", "deny");
|
||||
nix::writeFile("/proc/self/uid_map", nix::fmt("%d %d %d", uid, uid, 1));
|
||||
nix::writeFile("/proc/self/gid_map", nix::fmt("%d %d %d", gid, gid, 1));
|
||||
|
||||
execvp(cmd.c_str(), stringsToCharPtrs(args).data());
|
||||
execvp(cmd.c_str(), nix::stringsToCharPtrs(args).data());
|
||||
|
||||
throw SysError("unable to exec '%s'", cmd);
|
||||
throw nix::SysError("unable to exec '%s'", cmd);
|
||||
|
||||
#else
|
||||
throw Error(
|
||||
throw nix::Error(
|
||||
"mounting the Nix store on '%s' is not supported on this platform",
|
||||
storeDir);
|
||||
#endif
|
||||
|
|
8
third_party/nix/src/nix/search.cc
vendored
8
third_party/nix/src/nix/search.cc
vendored
|
@ -14,8 +14,7 @@
|
|||
#include "libutil/json.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace {
|
||||
std::string wrap(const std::string& prefix, const std::string& s) {
|
||||
return prefix + s + ANSI_NORMAL;
|
||||
}
|
||||
|
@ -26,7 +25,9 @@ std::string hilite(const std::string& s, const std::smatch& m,
|
|||
: std::string(m.prefix()) + ANSI_RED + std::string(m.str()) +
|
||||
postfix + std::string(m.suffix());
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace nix {
|
||||
struct CmdSearch final : SourceExprCommand, MixJSON {
|
||||
std::vector<std::string> res;
|
||||
|
||||
|
@ -270,5 +271,6 @@ struct CmdSearch final : SourceExprCommand, MixJSON {
|
|||
}
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdSearch>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdSearch>());
|
||||
|
|
6
third_party/nix/src/nix/show-config.cc
vendored
6
third_party/nix/src/nix/show-config.cc
vendored
|
@ -4,8 +4,7 @@
|
|||
#include "libutil/json.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct CmdShowConfig final : Command, MixJSON {
|
||||
CmdShowConfig() = default;
|
||||
|
||||
|
@ -27,5 +26,6 @@ struct CmdShowConfig final : Command, MixJSON {
|
|||
}
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdShowConfig>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdShowConfig>());
|
||||
|
|
6
third_party/nix/src/nix/show-derivation.cc
vendored
6
third_party/nix/src/nix/show-derivation.cc
vendored
|
@ -7,8 +7,7 @@
|
|||
#include "libutil/json.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct CmdShowDerivation final : InstallablesCommand {
|
||||
bool recursive = false;
|
||||
|
||||
|
@ -109,5 +108,6 @@ struct CmdShowDerivation final : InstallablesCommand {
|
|||
std::cout << "\n";
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdShowDerivation>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdShowDerivation>());
|
||||
|
|
7
third_party/nix/src/nix/sigs.cc
vendored
7
third_party/nix/src/nix/sigs.cc
vendored
|
@ -7,8 +7,7 @@
|
|||
#include "libutil/thread-pool.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct CmdCopySigs final : StorePathsCommand {
|
||||
Strings substituterUris;
|
||||
|
||||
|
@ -97,7 +96,7 @@ struct CmdCopySigs final : StorePathsCommand {
|
|||
}
|
||||
};
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdCopySigs>());
|
||||
static nix::RegisterCommand r1(make_ref<CmdCopySigs>());
|
||||
|
||||
struct CmdSignPaths final : StorePathsCommand {
|
||||
Path secretKeyFile;
|
||||
|
@ -143,3 +142,5 @@ struct CmdSignPaths final : StorePathsCommand {
|
|||
};
|
||||
|
||||
static RegisterCommand r3(make_ref<CmdSignPaths>());
|
||||
|
||||
} // namespace nix
|
||||
|
|
6
third_party/nix/src/nix/upgrade-nix.cc
vendored
6
third_party/nix/src/nix/upgrade-nix.cc
vendored
|
@ -11,8 +11,7 @@
|
|||
#include "libstore/store-api.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct CmdUpgradeNix final : MixDryRun, StoreCommand {
|
||||
Path profileDir;
|
||||
std::string storePathsUrl =
|
||||
|
@ -163,5 +162,6 @@ struct CmdUpgradeNix final : MixDryRun, StoreCommand {
|
|||
return state->forceString(*v2);
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdUpgradeNix>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdUpgradeNix>());
|
||||
|
|
6
third_party/nix/src/nix/verify.cc
vendored
6
third_party/nix/src/nix/verify.cc
vendored
|
@ -8,8 +8,7 @@
|
|||
#include "libutil/thread-pool.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace nix {
|
||||
struct CmdVerify final : StorePathsCommand {
|
||||
bool noContents = false;
|
||||
bool noTrust = false;
|
||||
|
@ -167,5 +166,6 @@ struct CmdVerify final : StorePathsCommand {
|
|||
(failed != 0u ? 4 : 0));
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdVerify>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdVerify>());
|
||||
|
|
8
third_party/nix/src/nix/why-depends.cc
vendored
8
third_party/nix/src/nix/why-depends.cc
vendored
|
@ -7,8 +7,7 @@
|
|||
#include "libstore/store-api.hh"
|
||||
#include "nix/command.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
namespace {
|
||||
static std::string hilite(const std::string& s, size_t pos, size_t len,
|
||||
const std::string& colour = ANSI_RED) {
|
||||
return std::string(s, 0, pos) + colour + std::string(s, pos, len) +
|
||||
|
@ -22,7 +21,9 @@ static std::string filterPrintable(const std::string& s) {
|
|||
}
|
||||
return res;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace nix {
|
||||
struct CmdWhyDepends final : SourceExprCommand {
|
||||
std::string _package, _dependency;
|
||||
bool all = false;
|
||||
|
@ -263,5 +264,6 @@ struct CmdWhyDepends final : SourceExprCommand {
|
|||
}
|
||||
}
|
||||
};
|
||||
} // namespace nix
|
||||
|
||||
static RegisterCommand r1(make_ref<CmdWhyDepends>());
|
||||
static nix::RegisterCommand r1(nix::make_ref<nix::CmdWhyDepends>());
|
||||
|
|
Loading…
Reference in a new issue