From: Stefan Schubert Date: Wed, 4 Jul 2007 15:09:44 +0000 (+0000) Subject: Added an initial installation flag which shows if the item has been X-Git-Tag: 6.6.0~2145 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c5cc59a7962ba02e50d334d1e7fafb4481113eb5;p=platform%2Fupstream%2Flibzypp.git Added an initial installation flag which shows if the item has been triggered for installation, or the dependency is already satisfied. --- diff --git a/zypp/solver/detail/QueueItemInstall.cc b/zypp/solver/detail/QueueItemInstall.cc index 028db2c46..ed3f1473f 100644 --- a/zypp/solver/detail/QueueItemInstall.cc +++ b/zypp/solver/detail/QueueItemInstall.cc @@ -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); } diff --git a/zypp/solver/detail/Resolver.cc b/zypp/solver/detail/Resolver.cc index dbca2ed23..9470c6afd 100644 --- a/zypp/solver/detail/Resolver.cc +++ b/zypp/solver/detail/Resolver.cc @@ -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)); } diff --git a/zypp/solver/detail/Resolver.h b/zypp/solver/detail/Resolver.h index 5b5c82f2f..37ab49c56 100644 --- a/zypp/solver/detail/Resolver.h +++ b/zypp/solver/detail/Resolver.h @@ -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 ItemCapKindMap; diff --git a/zypp/solver/detail/ResolverInfoNeededBy.cc b/zypp/solver/detail/ResolverInfoNeededBy.cc index 22155b3f0..f81739904 100644 --- a/zypp/solver/detail/ResolverInfoNeededBy.cc +++ b/zypp/solver/detail/ResolverInfoNeededBy.cc @@ -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) { } diff --git a/zypp/solver/detail/ResolverInfoNeededBy.h b/zypp/solver/detail/ResolverInfoNeededBy.h index d8656e672..b81567a93 100644 --- a/zypp/solver/detail/ResolverInfoNeededBy.h +++ b/zypp/solver/detail/ResolverInfoNeededBy.h @@ -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;}; }; ///////////////////////////////////////////////////////////////////