[zypp-commit] r9747 - in /trunk/libzypp/zypp/solver/detail: SolverQueueItemInstallOneOf.cc SolverQueueItemInstallOneOf.h
Author: schubi2 Date: Mon Apr 21 10:50:25 2008 New Revision: 9747 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9747&view=rev Log: added weak Modified: trunk/libzypp/zypp/solver/detail/SolverQueueItemInstallOneOf.cc trunk/libzypp/zypp/solver/detail/SolverQueueItemInstallOneOf.h Modified: trunk/libzypp/zypp/solver/detail/SolverQueueItemInstallOneOf.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/SolverQueueItemInstallOneOf.cc?rev=9747&r1=9746&r2=9747&view=diff ============================================================================== --- trunk/libzypp/zypp/solver/detail/SolverQueueItemInstallOneOf.cc (original) +++ trunk/libzypp/zypp/solver/detail/SolverQueueItemInstallOneOf.cc Mon Apr 21 10:50:25 2008 @@ -41,7 +41,7 @@ std::ostream & SolverQueueItemInstallOneOf::dumpOn( std::ostream & os ) const { - os << "[" << "InstallOneOf: "; + os << "[" << (_soft?"Soft":"") << "InstallOneOf: "; for (PoolItemList::const_iterator iter = _oneOfList.begin(); iter != _oneOfList.end(); iter++) @@ -53,9 +53,11 @@ //--------------------------------------------------------------------------- -SolverQueueItemInstallOneOf::SolverQueueItemInstallOneOf (const ResPool & pool, const PoolItemList & itemList) +SolverQueueItemInstallOneOf::SolverQueueItemInstallOneOf (const ResPool & pool, const PoolItemList & itemList, + bool soft) : SolverQueueItem (QUEUE_ITEM_TYPE_INSTALL_ONE_OF, pool) , _oneOfList (itemList) + , _soft (soft) { } @@ -69,8 +71,14 @@ bool SolverQueueItemInstallOneOf::addRule (_Queue & q) { bool ret = true; - MIL << "Install one of: " << endl; - queue_push( &(q), SOLVER_INSTALL_SOLVABLE_ONE_OF ); + MIL << "Install one of " << (_soft ? "(soft):" : ":")<< endl; + + if (_soft) { + queue_push( &(q), SOLVER_INSTALL_SOLVABLE_ONE_OF | SOLVER_WEAK); + } else { + queue_push( &(q), SOLVER_INSTALL_SOLVABLE_ONE_OF ); + } + for (PoolItemList::const_iterator iter = _oneOfList.begin(); iter != _oneOfList.end(); iter++) { Id id = (*iter)->satSolvable().id(); if (id == ID_NULL) { @@ -91,6 +99,7 @@ { SolverQueueItemInstallOneOf_Ptr new_installOneOf = new SolverQueueItemInstallOneOf (pool(), _oneOfList); new_installOneOf->SolverQueueItem::copy(this); + new_installOneOf->_soft = _soft; return new_installOneOf; } Modified: trunk/libzypp/zypp/solver/detail/SolverQueueItemInstallOneOf.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/SolverQueueItemInstallOneOf.h?rev=9747&r1=9746&r2=9747&view=diff ============================================================================== --- trunk/libzypp/zypp/solver/detail/SolverQueueItemInstallOneOf.h (original) +++ trunk/libzypp/zypp/solver/detail/SolverQueueItemInstallOneOf.h Mon Apr 21 10:50:25 2008 @@ -48,10 +48,11 @@ private: PoolItemList _oneOfList; // List of candidates + bool _soft; // if triggered by a soft requirement (a recommends) public: - SolverQueueItemInstallOneOf (const ResPool & pool, const PoolItemList & itemList); + SolverQueueItemInstallOneOf (const ResPool & pool, const PoolItemList & itemList, bool soft = false); virtual ~SolverQueueItemInstallOneOf(); // ---------------------------------- I/O @@ -61,6 +62,10 @@ friend std::ostream& operator<<(std::ostream & str, const SolverQueueItemInstallOneOf & obj) { return obj.dumpOn (str); } + // ---------------------------------- accessors + + bool isSoft (void) const { return _soft; } + // ---------------------------------- methods virtual bool addRule (_Queue & q); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
schubi2@svn.opensuse.org