[Aptitude-devel] r3162 - in branches/aptitude-0.3/aptitude: . src

Daniel Burrows dburrows@costa.debian.org
Thu, 28 Apr 2005 01:16:00 +0000


Author: dburrows
Date: Thu Apr 28 01:15:57 2005
New Revision: 3162

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/main.cc
Log:
Handle command-line errors too.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Thu Apr 28 01:15:57 2005
@@ -1,5 +1,10 @@
 2005-04-27  Daniel Burrows  <dburrows@debian.org>
 
+	* src/main.cc:
+
+	  Hook the layer of indirection up to "dump errors to cerr" before
+	  executing command-line requests.
+
 	* src/generic/apt.cc, src/generic/apt.h, src/ui.cc:
 
 	  Add a layer of indirection (a signal) between the request to

Modified: branches/aptitude-0.3/aptitude/src/main.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/main.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/main.cc	Thu Apr 28 01:15:57 2005
@@ -50,6 +50,7 @@
 
 #include <sigc++/functors/ptr_fun.h>
 
+#include <apt-pkg/error.h>
 #include <apt-pkg/init.h>
 
 #include "ui.h"
@@ -327,6 +328,10 @@
   // Possibly run off and do other commands.
   if(optind!=argc)
     {
+      // Connect up the "please consume errors" routine for the
+      // command-line.
+      consume_errors.connect(sigc::mem_fun(_error, &GlobalError::DumpErrors));
+
       if(update_only || install_only)
 	{
 	  fprintf(stderr, "%s",