mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
Implement --delete-generations + flag for keeping last N number of generations
This commit is contained in:
parent
4a000cbb39
commit
429154b74c
4 changed files with 32 additions and 2 deletions
|
@ -1284,6 +1284,8 @@ static void opDeleteGenerations(Globals & globals, Strings opFlags, Strings opAr
|
|||
deleteOldGenerations(globals.profile, globals.dryRun);
|
||||
} else if (opArgs.size() == 1 && opArgs.front().find('d') != string::npos) {
|
||||
deleteGenerationsOlderThan(globals.profile, opArgs.front(), globals.dryRun);
|
||||
} else if (opArgs.size() == 1 && opArgs.front().find('+') != string::npos) {
|
||||
deleteGenerationsGreaterThan(globals.profile, opArgs.front(), globals.dryRun);
|
||||
} else {
|
||||
std::set<unsigned int> gens;
|
||||
for (auto & i : opArgs) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue