From 59e81cec3e2277e367f14f113168421909c42035 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 24 Jan 2014 20:33:02 +0100 Subject: add "apt full-upgrade" and tweak "apt upgrade" There is a new "apt full-upgrade" that performs a apt-get dist-upgrade. "apt dist-upgrade" is still supported as a alias. The "apt upgrade" code is changed so that it mirrors the behavior of "apt-get upgrade --with-new-pkgs" and also honors "apt uprade --no-new-pkgs". --- apt-private/private-cmndline.cc | 5 ----- apt-private/private-upgrade.cc | 9 +++++++++ apt-private/private-upgrade.h | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'apt-private') diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index cbb40d42e..d6d7bca64 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -230,11 +230,6 @@ bool addArgumentsAPT(std::vector &Args, char const * const Cm addArg('v', "verbose", "APT::Cmd::List-Include-Summary", 0); addArg('a', "all-versions", "APT::Cmd::All-Versions", 0); } - else if (CmdMatches("upgrade")) - { - // FIXME: find a better term - addArg(0,"dist","APT::Cmd::Dist-Upgrade", CommandLine::Boolean); - } else if (addArgumentsAPTGet(Args, Cmd) || addArgumentsAPTCache(Args, Cmd)) { // we have no (supported) command-name overlaps so far, so we call diff --git a/apt-private/private-upgrade.cc b/apt-private/private-upgrade.cc index e76b5d7fc..a97e6d25b 100644 --- a/apt-private/private-upgrade.cc +++ b/apt-private/private-upgrade.cc @@ -1,3 +1,4 @@ + // Includes /*{{{*/ #include #include @@ -39,6 +40,14 @@ bool DoDistUpgrade(CommandLine &CmdL) return UpgradeHelper(CmdL, 0); } /*}}}*/ +bool DoUpgrade(CommandLine &CmdL) /*{{{*/ +{ + if (_config->FindB("APT::Get::Upgrade-Allow-New", false) == true) + return DoUpgradeWithAllowNewPackages(CmdL); + else + return DoUpgradeNoNewPackages(CmdL); +} + /*}}}*/ // DoUpgradeNoNewPackages - Upgrade all packages /*{{{*/ // --------------------------------------------------------------------- /* Upgrade all packages without installing new packages or erasing old diff --git a/apt-private/private-upgrade.h b/apt-private/private-upgrade.h index 050d3a668..5efc66bf7 100644 --- a/apt-private/private-upgrade.h +++ b/apt-private/private-upgrade.h @@ -5,6 +5,7 @@ bool DoDistUpgrade(CommandLine &CmdL); +bool DoUpgrade(CommandLine &CmdL); bool DoUpgradeNoNewPackages(CommandLine &CmdL); bool DoUpgradeWithAllowNewPackages(CommandLine &CmdL); -- cgit v1.2.3