1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

this updates issues that were addressed by people in pr

This commit is contained in:
Matthew O'Gorman 2016-05-19 15:42:54 -04:00
parent 429154b74c
commit 0312d30315
3 changed files with 14 additions and 13 deletions

View file

@ -1285,7 +1285,13 @@ static void opDeleteGenerations(Globals & globals, Strings opFlags, Strings opAr
} 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);
if(opArgs.front().size() < 2)
throw Error(format("invalid number of generations %1%") % opArgs.front());
string str_max = string(opArgs.front() 1, opArgs.front().size());
int max;
if (!string2Int(str_max, max) || max == 0)
throw Error(format("invalid number of generations to keep %1%") % opArgs.front());
deleteGenerationsGreaterThan(globals.profile, max, globals.dryRun);
} else {
std::set<unsigned int> gens;
for (auto & i : opArgs) {