]> git.saurik.com Git - apt.git/blobdiff - apt-private/private-upgrade.cc
test: Avoid use of /proc/self/fd
[apt.git] / apt-private / private-upgrade.cc
index a97e6d25b3afdc02abeb684cc9cf4f35f5fa6f8d..679140bfd3215c43c1430ed08b3e9e250361cb4b 100644 (file)
@@ -1,34 +1,33 @@
-
 // Includes                                                            /*{{{*/
-#include <apt-pkg/algorithms.h>
+#include <config.h>
+
 #include <apt-pkg/upgrade.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/error.h>
+
+#include <apt-private/private-install.h>
+#include <apt-private/private-cachefile.h>
+#include <apt-private/private-upgrade.h>
+#include <apt-private/private-output.h>
+
 #include <iostream>
-#include "private-install.h"
-#include "private-cachefile.h"
-#include "private-upgrade.h"
-#include "private-output.h"
+
+#include <apti18n.h>
                                                                        /*}}}*/
 
 // this is actually performing the various upgrade operations 
 static bool UpgradeHelper(CommandLine &CmdL, int UpgradeFlags)
 {
    CacheFile Cache;
+   std::vector<std::string> VolatileCmdL;
+   Cache.GetSourceList()->AddVolatileFiles(CmdL, &VolatileCmdL);
+
    if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false)
       return false;
 
-   c0out << _("Calculating upgrade... ") << std::flush;
-   if (APT::Upgrade::Upgrade(Cache, UpgradeFlags) == false)
-   {
-      c0out << _("Failed") << std::endl;
-      ShowBroken(c1out,Cache,false);
-      return _error->Error(_("Internal error, Upgrade broke stuff"));
-   }
-   c0out << _("Done") << std::endl;
-
-   // parse additional cmdline pkg manipulation switches
-   if(!DoCacheManipulationFromCommandLine(CmdL, Cache))
+   if(!DoCacheManipulationFromCommandLine(CmdL, VolatileCmdL,  Cache, UpgradeFlags))
       return false;
-   
+
    return InstallPackages(Cache,true);
 }
 
@@ -37,7 +36,7 @@ static bool UpgradeHelper(CommandLine &CmdL, int UpgradeFlags)
 /* Intelligent upgrader that will install and remove packages at will */
 bool DoDistUpgrade(CommandLine &CmdL)
 {
-   return UpgradeHelper(CmdL, 0);
+   return UpgradeHelper(CmdL, APT::Upgrade::ALLOW_EVERYTHING);
 }
                                                                        /*}}}*/
 bool DoUpgrade(CommandLine &CmdL)                                      /*{{{*/