list-updates fix (bnc #483910)
authorJán Kupec <jkupec@suse.cz>
Tue, 10 Mar 2009 15:48:40 +0000 (16:48 +0100)
committerJán Kupec <jkupec@suse.cz>
Tue, 10 Mar 2009 15:48:40 +0000 (16:48 +0100)
Avoiding showing not-yet-installed packages in list-updates output.

src/update.cc

index eebee6a..7bb21af 100755 (executable)
@@ -18,6 +18,8 @@ using namespace boost;
 
 extern ZYpp::Ptr God;
 
+static PoolItem
+findInstalledItem( PoolItem item );
 
 // ----------------------------------------------------------------------------
 //
@@ -294,7 +296,9 @@ find_updates( const ResKind & kind, Candidates & candidates )
       it = God->pool().begin(),
       e  = God->pool().end();
     for (; it != e; ++it)
-      if (it->status().isToBeInstalled())
+      // show every package picked by doUpdate for installation
+      // except the ones which are not currently installed (bnc #483910)
+      if (it->status().isToBeInstalled() && findInstalledItem(*it))
         candidates.insert(*it);
     return;
   }