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

Daniel Burrows dburrows@costa.debian.org
Sun, 01 May 2005 00:14:02 +0000


Author: dburrows
Date: Sun May  1 00:13:59 2005
New Revision: 3216

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/generic/aptcache.cc
   branches/aptitude-0.3/aptitude/src/generic/aptcache.h
Log:
Set the install/remove_reason of packages modified by the resolver to indicate
that they were, in fact, modified by the resolver.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Sun May  1 00:13:59 2005
@@ -1,5 +1,10 @@
 2005-04-30  Daniel Burrows  <dburrows@debian.org>
 
+	* src/generic/aptcache.cc:
+
+	  Make packages installed/removed by the resolver get marked as
+	  "automatic" (using a new changed_reason value).
+
 	* src/solution_dialog.cc:
 
 	  Make the top row of the dialog shrinkable, so the buttons never

Modified: branches/aptitude-0.3/aptitude/src/generic/aptcache.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/aptcache.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/generic/aptcache.cc	Sun May  1 00:13:59 2005
@@ -1439,8 +1439,12 @@
 
       // Check what type of action it is.
       if(actionver.end())
-	// removal.
-	internal_mark_delete(pkg, false, false, undo, false);
+	{
+	  // removal.
+	  internal_mark_delete(pkg, false, false, undo, false);
+	  if(!curver.end())
+	    get_ext_state(pkg).remove_reason=from_resolver;
+	}
       else if(actionver == curver)
 	// keep
 	internal_mark_keep(pkg, false, false, undo, false);
@@ -1449,6 +1453,8 @@
 	{
 	  set_candidate_version(actionver, undo);
 	  internal_mark_install(pkg, false, false, undo, false);
+	  if(curver.end())
+	    get_ext_state(pkg).install_reason=from_resolver;
 	}
     }
 

Modified: branches/aptitude-0.3/aptitude/src/generic/aptcache.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/aptcache.h	(original)
+++ branches/aptitude-0.3/aptitude/src/generic/aptcache.h	Sun May  1 00:13:59 2005
@@ -51,7 +51,7 @@
   /** This is a general enum that's used for several purposes by the
    *  extended state.  Not every value is valid in every case.
    */
-  enum changed_reason {manual, user_auto, libapt, temp_hold, unused};
+  enum changed_reason {manual, user_auto, libapt, from_resolver, unused};
 
   /** This structure augments the basic depCache state structure to
    *  support special aptitude features.