[Aptitude-svn-commit] r4347 - in branches/aptitude-0.3/aptitude: . src/cmdline

Daniel Burrows dburrows at costa.debian.org
Thu Sep 29 23:28:27 UTC 2005


Author: dburrows
Date: Thu Sep 29 23:28:24 2005
New Revision: 4347

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/cmdline/cmdline_upgrade.cc
Log:
Use the download_manager code to do upgrades too.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Thu Sep 29 23:28:24 2005
@@ -1,5 +1,9 @@
 2005-09-29  Daniel Burrows  <dburrows at debian.org>
 
+	* src/cmdline/cmdline_upgrade.cc:
+
+	  Use the download_manager code for upgrades too.
+
 	* src/pkg_item.cc, src/pkg_tree.cc:
 
 	  Eliminate more unnecessary #includes.

Modified: branches/aptitude-0.3/aptitude/src/cmdline/cmdline_upgrade.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/cmdline/cmdline_upgrade.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/cmdline/cmdline_upgrade.cc	Thu Sep 29 23:28:24 2005
@@ -11,11 +11,10 @@
 #include "cmdline_util.h"
 
 #include <aptitude.h>
-#include <download.h>
 
 #include <generic/apt/apt.h>
 #include <generic/apt/config_signal.h>
-#include <generic/apt/download_signal_log.h>
+#include <generic/apt/download_install_manager.h>
 
 #include <apt-pkg/depcache.h>
 #include <apt-pkg/error.h>
@@ -106,37 +105,9 @@
 	  return 0;
 	}
 
-
-
-      // Split this into common code?
-      download_signal_log *m = gen_cmdline_download_progress();
-      pkgAcquire *acq;
-      pkgPackageManager *pm;
-
-      bool success = prepare_install_run(&progress, true,
-					 download_only, m,
-					 acq, pm);
-      install_run_result run_res;
-
-      if(success)
-	{
-	  do
-	    {
-	      pkgAcquire::RunResult res = acq->Run();
-	      run_res = finish_install_run(&progress, true,
-					   download_only,
-					   m, acq, pm, res);
-	    } while(run_res == install_do_again);
-	}
-
-      delete acq;
-      delete pm;
-      delete m;
-
-
-
-
-      int rval = run_res == install_success ? 0 : -1;
+      download_install_manager m(download_only);
+      int rval =
+	(cmdline_do_download(&m) == download_manager::success ? 0 : -1);
 
       if(_error->PendingError())
 	rval = -1;



More information about the Aptitude-svn-commit mailing list