Michael Vogt лет назад: 12
Родитель
Сommit
82e7f817a4
2 измененных файлов с 15 добавлено и 1 удалено
  1. 5 0
      apt-private/private-cmndline.cc
  2. 10 1
      cmdline/apt.cc

+ 5 - 0
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

+ 10 - 1
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