Should be fixed with the attached patch.

  Daniel
Thu Nov 10 10:19:00 PST 2005  Daniel Burrows <[EMAIL PROTECTED]>
  * Just to be safe, clear the active dep information when update() is called 
while the package cache is invalid.
Thu Nov 10 10:17:47 PST 2005  Daniel Burrows <[EMAIL PROTECTED]>
  * When a solution screen is repainted while the package cache is closed, 
force it to be updated so old data is discarded and we don't segfault (Closes: 
#338441).
Thu Nov 10 10:16:58 PST 2005  Daniel Burrows <[EMAIL PROTECTED]>
  * Make the 'highlighted' methods of solution_items resiliant against a closed 
package cache.
Thu Nov 10 10:13:28 PST 2005  Daniel Burrows <[EMAIL PROTECTED]>
  * PrvIterator has a default constructor now, use it in 
aptitude_resolver_dep::aptitude_resolver_dep().
diff -rN -udp old-head/src/generic/apt/aptitude_resolver_universe.h 
new-head/src/generic/apt/aptitude_resolver_universe.h
--- old-head/src/generic/apt/aptitude_resolver_universe.h       2005-11-10 
10:20:37.000000000 -0800
+++ new-head/src/generic/apt/aptitude_resolver_universe.h       2005-11-10 
10:10:40.000000000 -0800
@@ -290,13 +290,9 @@ class aptitude_resolver_dep
   pkgCache::PrvIterator prv;
 public:
   /** \brief Generate an invalid dependency object.
-   *
-   *  \todo how prv is instantiated is a dreadful hack, but it's
-   *  needed to avoid crashing until PrvIterators get a sensible
-   *  default constructor.
    */
   aptitude_resolver_dep()
-    :cache(0), prv(*apt_cache_file, (pkgCache::Provides *) 1, 
(pkgCache::Package *) 0)
+    :cache(0), prv()
   {
   }
 
diff -rN -udp old-head/src/solution_item.cc new-head/src/solution_item.cc
--- old-head/src/solution_item.cc       2005-11-10 10:20:37.000000000 -0800
+++ new-head/src/solution_item.cc       2005-11-10 10:15:50.000000000 -0800
@@ -242,6 +242,13 @@ void solution_act_item::unmandate()
 
 void solution_act_item::highlighted(vs_tree *win)
 {
+  if(apt_cache_file == NULL)
+    {
+      set_short_description(fragf(""));
+      set_active_dep(aptitude_resolver_dep());
+      return;
+    }
+
   pkgCache::VerIterator real_ver = ver.get_ver();
 
   if(real_ver.end())
@@ -517,7 +524,10 @@ bool solution_unresolved_item::is_mandat
 
 void solution_unresolved_item::highlighted(vs_tree *win)
 {
-  set_active_dep(d);
+  if(apt_cache_file == NULL)
+    set_active_dep(aptitude_resolver_dep());
+  else
+    set_active_dep(d);
 }
 
 void solution_unresolved_item::unhighlighted(vs_tree *win)
diff -rN -udp old-head/src/solution_screen.cc new-head/src/solution_screen.cc
--- old-head/src/solution_screen.cc     2005-11-10 10:20:37.000000000 -0800
+++ new-head/src/solution_screen.cc     2005-11-10 10:10:06.000000000 -0800
@@ -448,6 +448,14 @@ public:
     return rval;
   }
 
+  void paint(const style &st)
+  {
+    if(apt_cache_file == NULL)
+      update();
+
+    vs_multiplex::paint(st);
+  }
+
   void update()
   {
     ref_ptr<solution_examiner> tmpref(this);
@@ -455,6 +463,7 @@ public:
     if(!apt_cache_file)
       {
        set_static_root(transcode(_("The package cache is not available.")));
+       set_active_dep(aptitude_resolver_dep());
        return;
       }
 

Attachment: signature.asc
Description: Digital signature

Reply via email to