]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt.cc
add apt upgrade --dist
[apt.git] / cmdline / apt.cc
index e30967ec216be1770d07f4ec74c998d28824bbce..4dc8266327260254fe9af548fc915438f10f4944 100644 (file)
@@ -41,6 +41,7 @@
 #include <apt-pkg/pkgsystem.h>
 #include <apt-pkg/indexfile.h>
 #include <apt-pkg/metaindex.h>
+#include <apt-pkg/hashes.h>
 
 #include <apti18n.h>
 
 #include <apt-private/private-upgrade.h>
 #include <apt-private/private-show.h>
 #include <apt-private/private-main.h>
+#include <apt-private/private-utils.h>
+#include <apt-private/private-sources.h>
                                                                        /*}}}*/
 
+
+
 bool ShowHelp(CommandLine &CmdL)
 {
    ioprintf(c1out,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION,
@@ -74,11 +79,22 @@ bool ShowHelp(CommandLine &CmdL)
       " update - update list of available packages\n"
       " install - install packages\n"
       " upgrade - upgrade the systems packages\n"
+      "\n"
+      " edit-sources - edit the source information file\n"
        );
    
    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},
@@ -88,7 +104,9 @@ int main(int argc, const char *argv[])                                       /*{{{*/
                                    {"install",&DoInstall},
                                    {"remove", &DoInstall},
                                    {"update",&DoUpdate},
-                                   {"upgrade",&DoUpgradeWithAllowNewPackages},
+                                   {"upgrade",&DoAptUpgrade},
+                                   // misc
+                                   {"edit-sources",&EditSources},
                                    // helper
                                    {"moo",&DoMoo},
                                    {"help",&ShowHelp},