mirror of
https://github.com/NixOS/nix
synced 2025-07-07 06:01:48 +02:00
Merge pull request #2579 from catern/dumpdb
nix-store: make --dump-db take a list of paths to dump
This commit is contained in:
commit
d8fe447139
2 changed files with 18 additions and 5 deletions
|
@ -485,11 +485,16 @@ static void opReadLog(Strings opFlags, Strings opArgs)
|
|||
static void opDumpDB(Strings opFlags, Strings opArgs)
|
||||
{
|
||||
if (!opFlags.empty()) throw UsageError("unknown flag");
|
||||
if (!opArgs.empty())
|
||||
throw UsageError("no arguments expected");
|
||||
PathSet validPaths = store->queryAllValidPaths();
|
||||
for (auto & i : validPaths)
|
||||
cout << store->makeValidityRegistration({i}, true, true);
|
||||
if (!opArgs.empty()) {
|
||||
for (auto & i : opArgs)
|
||||
i = store->followLinksToStorePath(i);
|
||||
for (auto & i : opArgs)
|
||||
cout << store->makeValidityRegistration({i}, true, true);
|
||||
} else {
|
||||
PathSet validPaths = store->queryAllValidPaths();
|
||||
for (auto & i : validPaths)
|
||||
cout << store->makeValidityRegistration({i}, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue