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

Daniel Burrows dburrows at costa.debian.org
Thu Sep 29 23:24:40 UTC 2005


Author: dburrows
Date: Thu Sep 29 23:24:37 2005
New Revision: 4344

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/cmdline/cmdline_update.cc
Log:
Use the download_manager stuff to handle updates.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Thu Sep 29 23:24:37 2005
@@ -1,5 +1,9 @@
 2005-09-29  Daniel Burrows  <dburrows at debian.org>
 
+	* src/cmdline/cmdline_update.cc:
+
+	  Use the download_manager code in 'update'.
+
 	* src/cmdline_do_action.cc:
 
 	  Use the download_manager code to handle stuff that gets kicked

Modified: branches/aptitude-0.3/aptitude/src/cmdline/cmdline_update.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/cmdline/cmdline_update.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/cmdline/cmdline_update.cc	Thu Sep 29 23:24:37 2005
@@ -1,6 +1,6 @@
 // cmdline_update.cc
 //
-//   Copyright (C) 2004 Daniel Burrows
+//   Copyright (C) 2004-2005 Daniel Burrows
 //
 //   This program is free software; you can redistribute it and/or
 //   modify it under the terms of the GNU General Public License as
@@ -17,14 +17,13 @@
 //   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 //   Boston, MA 02111-1307, USA.
 
-#include "../download.h"
-
-#include "cmdline_progress.h"
+#include "cmdline_util.h"
 
 #include <aptitude.h>
 
 #include <generic/apt/apt.h>
 #include <generic/apt/config_signal.h>
+#include <generic/apt/download_update_manager.h>
 #include <generic/apt/download_signal_log.h>
 
 #include <apt-pkg/error.h>
@@ -50,17 +49,9 @@
       return -1;
     }
 
-  download_signal_log *m = gen_cmdline_download_progress();
-  pkgAcquire *acq = prepare_pkglist_update(&progress, true, m);
-
-  int rval = 0;
-
-  if(acq != NULL)
-    {
-      pkgAcquire::RunResult res = acq->Run();
-      if(!finish_pkglist_update(&progress, true, m, acq, res))
-	rval = -1;
-    }
+  download_update_manager m;
+  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