[Aptitude-svn-commit] r4078 - in branches/aptitude-0.3/aptitude: . src/generic

Daniel Burrows dburrows at costa.debian.org
Wed Sep 14 15:59:47 UTC 2005


Author: dburrows
Date: Wed Sep 14 15:59:44 2005
New Revision: 4078

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:
Expose the apply-any-solution code to the outside world.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Wed Sep 14 15:59:44 2005
@@ -2,6 +2,12 @@
 
 	* src/generic/aptcache.cc, src/generic/aptcache.h:
 
+	  Add a method to the backend cache which applies a given
+	  solution, rather than just applying the currently selected
+	  solution.
+
+	* src/generic/aptcache.cc, src/generic/aptcache.h:
+
 	  Add a new signal that gets called *before* the package states
 	  change; this is needed to run the resolver in the background
 	  (since it's a reader of the depcache, it has to be killed before

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	Wed Sep 14 15:59:44 2005
@@ -1510,12 +1510,9 @@
   return resolver->is_forced_broken(dep);
 }
 
-
-
-void aptitudeDepCache::apply_current_solution(undo_group *undo)
+void aptitudeDepCache::apply_solution(const aptitude_resolver::solution &sol,
+				      undo_group *undo)
 {
-  aptitude_resolver::solution sol=get_current_solution();
-
   begin_action_group();
 
   for(imm::map<aptitude_resolver::package, aptitude_resolver::action>::const_iterator
@@ -1547,7 +1544,12 @@
 	}
     }
 
-  end_action_group(undo);
+  end_action_group(undo);  
+}
+
+void aptitudeDepCache::apply_current_solution(undo_group *undo)
+{
+  apply_solution(get_current_solution(), undo);
 }
 
 const aptitude_resolver::solution &aptitudeDepCache::next_solution()

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	Wed Sep 14 15:59:44 2005
@@ -422,6 +422,13 @@
    */
   const generic_solution<aptitude_universe> &get_current_solution();
 
+  /** Apply the given solution as a resolver result; any actions
+   *  that it requests will be marked as having been performed to
+   *  fulfill dependencies.
+   */
+  void apply_solution(const generic_solution<aptitude_universe> &solution,
+		      undo_group *undo);
+
   /** Requires that resolver_exists() is \b true.  If no solutions
    *  have been calculated yet, will calculate and apply the first
    *  solution.



More information about the Aptitude-svn-commit mailing list