mirror of
https://github.com/NixOS/nix
synced 2025-06-27 21:01:16 +02:00
Remove the --indirect flag
All GC roots are now indirect.
This commit is contained in:
parent
b07167be5a
commit
00d25e8457
6 changed files with 21 additions and 38 deletions
|
@ -20,7 +20,6 @@ using namespace nix;
|
|||
|
||||
static Path gcRoot;
|
||||
static int rootNr = 0;
|
||||
static bool indirectRoot = false;
|
||||
|
||||
|
||||
enum OutputKind { okPlain, okXML, okJSON };
|
||||
|
@ -71,11 +70,11 @@ void processExpr(EvalState & state, const Strings & attrPaths,
|
|||
if (gcRoot == "")
|
||||
printGCWarning();
|
||||
else {
|
||||
Path rootName = indirectRoot ? absPath(gcRoot) : gcRoot;
|
||||
Path rootName = absPath(gcRoot);
|
||||
if (++rootNr > 1) rootName += "-" + std::to_string(rootNr);
|
||||
auto store2 = state.store.dynamic_pointer_cast<LocalFSStore>();
|
||||
if (store2)
|
||||
drvPath = store2->addPermRoot(store2->parseStorePath(drvPath), rootName, indirectRoot);
|
||||
drvPath = store2->addPermRoot(store2->parseStorePath(drvPath), rootName, true);
|
||||
}
|
||||
std::cout << fmt("%s%s\n", drvPath, (outputName != "out" ? "!" + outputName : ""));
|
||||
}
|
||||
|
@ -127,7 +126,7 @@ static int _main(int argc, char * * argv)
|
|||
else if (*arg == "--add-root")
|
||||
gcRoot = getArg(*arg, arg, end);
|
||||
else if (*arg == "--indirect")
|
||||
indirectRoot = true;
|
||||
;
|
||||
else if (*arg == "--xml")
|
||||
outputKind = okXML;
|
||||
else if (*arg == "--json")
|
||||
|
|
|
@ -34,7 +34,6 @@ typedef void (* Operation) (Strings opFlags, Strings opArgs);
|
|||
|
||||
static Path gcRoot;
|
||||
static int rootNr = 0;
|
||||
static bool indirectRoot = false;
|
||||
static bool noOutput = false;
|
||||
static std::shared_ptr<Store> store;
|
||||
|
||||
|
@ -85,7 +84,7 @@ static PathSet realisePath(StorePathWithOutputs path, bool build = true)
|
|||
Path rootName = gcRoot;
|
||||
if (rootNr > 1) rootName += "-" + std::to_string(rootNr);
|
||||
if (i->first != "out") rootName += "-" + i->first;
|
||||
outPath = store2->addPermRoot(store->parseStorePath(outPath), rootName, indirectRoot);
|
||||
outPath = store2->addPermRoot(store->parseStorePath(outPath), rootName, true);
|
||||
}
|
||||
}
|
||||
outputs.insert(outPath);
|
||||
|
@ -104,7 +103,7 @@ static PathSet realisePath(StorePathWithOutputs path, bool build = true)
|
|||
Path rootName = gcRoot;
|
||||
rootNr++;
|
||||
if (rootNr > 1) rootName += "-" + std::to_string(rootNr);
|
||||
return {store2->addPermRoot(path.path, rootName, indirectRoot)};
|
||||
return {store2->addPermRoot(path.path, rootName, true)};
|
||||
}
|
||||
}
|
||||
return {store->printStorePath(path.path)};
|
||||
|
@ -1085,7 +1084,7 @@ static int _main(int argc, char * * argv)
|
|||
else if (*arg == "--add-root")
|
||||
gcRoot = absPath(getArg(*arg, arg, end));
|
||||
else if (*arg == "--indirect")
|
||||
indirectRoot = true;
|
||||
;
|
||||
else if (*arg == "--no-output")
|
||||
noOutput = true;
|
||||
else if (*arg != "" && arg->at(0) == '-') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue