nix-env --upgrade: show "downgrading" when doing so

It was strange to show "upgrading" when the version was getting lower.
This is left on "upgrading" when the versions are the same,
as I can't see any better wording.
This commit is contained in:
Vladimír Čunát 2015-09-17 12:08:49 +02:00
parent 12a4aea93d
commit 42808fa281

View file

@ -602,9 +602,11 @@ static void upgradeDerivations(Globals & globals,
i.queryOutPath() != i.queryOutPath() !=
bestElem->queryOutPath()) bestElem->queryOutPath())
{ {
const char * action = compareVersions(drvName.version, bestVersion) <= 0
? "upgrading" : "downgrading";
printMsg(lvlInfo, printMsg(lvlInfo,
format("upgrading %1% to %2%") format("%1% %2% to %3%")
% i.name % bestElem->name); % action % i.name % bestElem->name);
newElems.push_back(*bestElem); newElems.push_back(*bestElem);
} else newElems.push_back(i); } else newElems.push_back(i);