Added an initial installation flag which shows if the item has been
authorStefan Schubert <schubi@suse.de>
Wed, 4 Jul 2007 15:09:44 +0000 (15:09 +0000)
committerStefan Schubert <schubi@suse.de>
Wed, 4 Jul 2007 15:09:44 +0000 (15:09 +0000)
triggered for installation, or the dependency is already satisfied.

zypp/solver/detail/QueueItemInstall.cc
zypp/solver/detail/Resolver.cc
zypp/solver/detail/Resolver.h
zypp/solver/detail/ResolverInfoNeededBy.cc
zypp/solver/detail/ResolverInfoNeededBy.h

index 028db2c46c56ab4fb3559ef0fe94177cf9b5df11..ed3f1473f96eb8fc458589a282369d356e06510c 100644 (file)
@@ -384,6 +384,7 @@ QueueItemInstall::process (ResolverContext_Ptr context, QueueItemList & qil)
        info = new ResolverInfoNeededBy (_item);
        info->addRelatedPoolItem (_needed_by);
        info->setCapability (_dep_satisfied_by_this_install, _soft?Dep::RECOMMENDS:Dep::REQUIRES);
+       info->setInitialInstallation (true);
        context->addInfo (info);
     }
 
index dbca2ed233bf4a4ed3a08d815b47ad6f20791a24..9470c6afd00a02044d153e6d2d21986fa9c7d09b 100644 (file)
@@ -191,10 +191,10 @@ collector_cb_needed (ResolverInfo_Ptr info, void *data)
            
            for (PoolItemList::const_iterator iter = itemList.begin();
                 iter != itemList.end(); iter++) {
-               ItemCapKind capKind( *iter, needed_by->capability(), needed_by->capKind() );
+               ItemCapKind capKind( *iter, needed_by->capability(), needed_by->capKind(), needed_by->initialInstallation() );
                collector->isInstalledBy.insert (make_pair( item, capKind));
        
-               ItemCapKind capKindReverse( item, needed_by->capability(), needed_by->capKind() );
+               ItemCapKind capKindReverse( item, needed_by->capability(), needed_by->capKind(), needed_by->initialInstallation() );
                collector->installs.insert (make_pair( *iter, capKindReverse));
            }
            
index 5b5c82f2ff0b4d6af768f23d1be3d174df2e7f93..37ab49c567cd4be6a264e29c818b11e9b4198c09 100644 (file)
@@ -66,11 +66,14 @@ namespace zypp
        Capability cap; //Capability which has triggerd this selection
        Dep capKind; //Kind of that capability
        PoolItem_Ref item; //Item which has triggered this selection
+       bool initialInstallation; //This item has triggered the installation
+                                 //Not already fullfilled requierement only.
 
-           ItemCapKind( PoolItem i, Capability c, Dep k)
+           ItemCapKind( PoolItem i, Capability c, Dep k, bool initial)
                : cap( c )
                , capKind( k )
                , item( i )
+               , initialInstallation( initial )
            { }
     };
     typedef std::multimap<PoolItem_Ref,ItemCapKind> ItemCapKindMap;
index 22155b3f03e57e5f6165794b77de47341f3472e2..f81739904688996e0d5df1f698b79148a50662d6 100644 (file)
@@ -153,6 +153,7 @@ ResolverInfoNeededBy::ResolverInfoNeededBy (PoolItem_Ref item)
     : ResolverInfoContainer (RESOLVER_INFO_TYPE_NEEDED_BY, item, RESOLVER_INFO_PRIORITY_USER)
     , _cap(Capability::noCap)
     , _capKind(Dep::REQUIRES)
+    , _initialInstallation(false)
 {
 }
 
index d8656e67228e66111fe78848b1b1a12ef3d1e081..b81567a93ea305a2a26d07aae5459e1cb33b16dd 100644 (file)
@@ -46,6 +46,7 @@ class ResolverInfoNeededBy : public ResolverInfoContainer {
   private:
     Capability _cap;
     Dep _capKind;
+    bool _initialInstallation; 
 
   public:
 
@@ -65,8 +66,10 @@ class ResolverInfoNeededBy : public ResolverInfoContainer {
     virtual std::string message (void) const;
     virtual ResolverInfo_Ptr copy (void) const;
     void setCapability (const Capability & cap, const Dep & capKind) { _cap = cap; _capKind = capKind; }
+    void setInitialInstallation (const bool initial) { _initialInstallation = initial; }
     Dep capKind() const {return _capKind;}
     Capability capability() const {return _cap;};
+    bool initialInstallation() const {return _initialInstallation;};
 };
 
  ///////////////////////////////////////////////////////////////////