On Thu, Dec 20, 2007 at 12:15:35PM +0100, Jiří Paleček <[EMAIL PROTECTED]> was 
heard to say:
> I tried to install the fbdev xorg video driver and got this error from 
> aptitude while resolving dependencies.
>
> The situation is as follows: there are two versions of -video-fbdev, 
> 0.4.1-1 (testing) and 0.4.1-4. The former provides -video-driver-1.0, the 
> latter provides -video-driver-2. My version of xorg conflicts with 
> -video-driver-1.0.
>
> What happened: after I selected -video-fbdev, the testing version was 
> selected. This selection conflicts with my xorg, so I went to the resolver. 
> I selected the solution of installing the unstable version, and tried to 
> use that solution. At this moment, I got the error "unexpected empty 
> solution" (or something, it was in Czech). The correct driver package was 
> selected, but xorg still was marked as broken. Even when I've undone 
> everything, xorg was marked as broken although the selection did not 
> contain any conflicts.
>
> When I selected the unstable version in the beginning, everything was OK.

  Could you try the attached patch an let me know if it cleans this up?

  Daniel

diff -r 7709167d6e01 -r 0fa4c7736352 src/generic/apt/aptcache.cc
--- a/src/generic/apt/aptcache.cc       Sun Dec 16 11:59:25 2007 -0800
+++ b/src/generic/apt/aptcache.cc       Mon Dec 17 08:55:56 2007 -0800
@@ -502,6 +502,8 @@ void aptitudeDepCache::mark_all_upgradab
       return;
     }
 
+  pre_package_state_changed();
+
   action_group group(*this, undo);
 
   for(int iter=0; iter==0 || (iter==1 && with_autoinst); ++iter)
@@ -808,6 +810,18 @@ void aptitudeDepCache::cleanup_after_cha
         
package_states[pkg->ID].remove_reason!=backup_state.AptitudeState[pkg->ID].remove_reason
 ||
         
package_states[pkg->ID].forbidver!=backup_state.AptitudeState[pkg->ID].forbidver)
        {
+         // Technically this could be invoked only when we're really
+         // about to change a package's state, but placing it here
+         // should avoid signalling changes unnecessarily while still
+         // signalling a change whenever something changed.
+         //
+         // You could argue that this invocation of
+         // pre_package_state_changed makes all other unnecessary,
+         // but I think they should be left in for safety's sake.
+         // Forgetting to call pre_package_state_changed can lead to
+         // hard to track down bugs like #432411.
+         pre_package_state_changed();
+
          int n=pkg->ID;
          n=n;
          char curM=PkgState[pkg->ID].Mode;
@@ -1324,6 +1338,7 @@ void aptitudeDepCache::sweep()
              // not previously being deleted.
              if(!PkgState[pkg->ID].Delete())
                {
+                 pre_package_state_changed();
                  MarkDelete(pkg, purge_unused);
                  package_states[pkg->ID].selection_state =
                    (purge_unused ? pkgCache::State::Purge : 
pkgCache::State::DeInstall);
@@ -1341,11 +1356,13 @@ void aptitudeDepCache::sweep()
                }
              else
                package_states[pkg->ID].selection_state = 
pkgCache::State::Install;
+             pre_package_state_changed();
              MarkKeep(pkg, false, false);
            }
        }
       else if(PkgState[pkg->ID].Delete() && 
package_states[pkg->ID].remove_reason == unused)
        {
+         pre_package_state_changed();
          MarkKeep(pkg, false, false);
        }
     }

Reply via email to