diff options
author | Michael Vogt <mvo@debian.org> | 2014-01-17 07:48:43 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-01-17 07:48:43 +0100 |
commit | 82e7f817a434e29df9ec6fbf19acfd8e7cd890e5 (patch) | |
tree | df72368ef295a7682c9cf19369493c8d7358d474 | |
parent | 2a79257e96010318c4bc6d2f2e3e9c475e5bf445 (diff) |
add apt upgrade --dist
-rw-r--r-- | apt-private/private-cmndline.cc | 5 | ||||
-rw-r--r-- | cmdline/apt.cc | 11 |
2 files changed, 15 insertions, 1 deletions
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index d6d7bca64..cbb40d42e 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -230,6 +230,11 @@ bool addArgumentsAPT(std::vector<CommandLine::Args> &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/cmdline/apt.cc b/cmdline/apt.cc index 4bcae0aba..4dc826632 100644 --- a/cmdline/apt.cc +++ b/cmdline/apt.cc @@ -86,6 +86,15 @@ bool ShowHelp(CommandLine &CmdL) return true; } +// figure out what kind of upgrade the user wants +bool DoAptUpgrade(CommandLine &CmdL) +{ + if (_config->FindB("Apt::Cmd::Dist-Upgrade")) + return DoDistUpgrade(CmdL); + else + return DoUpgradeWithAllowNewPackages(CmdL); +} + int main(int argc, const char *argv[]) /*{{{*/ { CommandLine::Dispatch Cmds[] = {{"list",&List}, @@ -95,7 +104,7 @@ int main(int argc, const char *argv[]) /*{{{*/ {"install",&DoInstall}, {"remove", &DoInstall}, {"update",&DoUpdate}, - {"upgrade",&DoUpgradeWithAllowNewPackages}, + {"upgrade",&DoAptUpgrade}, // misc {"edit-sources",&EditSources}, // helper |