Author: schubi2 Date: Thu Apr 10 10:20:17 2008 New Revision: 9500 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9500&view=rev Log: added isRelevant Modified: trunk/libzypp/zypp/PoolItem.cc trunk/libzypp/zypp/PoolItem.h trunk/libzypp/zypp/Resolvable.h trunk/libzypp/zypp/sat/Solvable.cc trunk/libzypp/zypp/sat/Solvable.h Modified: trunk/libzypp/zypp/PoolItem.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/PoolItem.cc?rev=9500&r1=9499&r2=9500&view=diff ============================================================================== --- trunk/libzypp/zypp/PoolItem.cc (original) +++ trunk/libzypp/zypp/PoolItem.cc Thu Apr 10 10:20:17 2008 @@ -59,6 +59,11 @@ return _resolvable->isSatisfied(); } + bool isRelevant() const + { + return _resolvable->isRelevant(); + } + private: mutable ResStatus _status; ResObject::constPtr _resolvable; Modified: trunk/libzypp/zypp/PoolItem.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/PoolItem.h?rev=9500&r1=9499&r2=9500&view=diff ============================================================================== --- trunk/libzypp/zypp/PoolItem.h (original) +++ trunk/libzypp/zypp/PoolItem.h Thu Apr 10 10:20:17 2008 @@ -82,6 +82,11 @@ bool isBroken() const { return ! isSatisfied(); } + /** Returns true if the solvable is relevant which means e.G. for patches + * that at least one package of the patch is installed. + */ + bool isRelevant() const; + public: /** Return the \ref ResPool the item belongs to. */ ResPool pool() const; Modified: trunk/libzypp/zypp/Resolvable.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Resolvable.h?rev=9500&r1=9499&r2=9500&view=diff ============================================================================== --- trunk/libzypp/zypp/Resolvable.h (original) +++ trunk/libzypp/zypp/Resolvable.h Thu Apr 10 10:20:17 2008 @@ -84,8 +84,14 @@ public: /** Returns true if the solvable is satisfied */ using sat::Solvable::isSatisfied; + /** Returns true if the solvable is satisfied */ - using sat::Solvable::isBroken; + using sat::Solvable::isBroken; + + /** Returns true if the solvable is relevant which means e.G. for patches + * that at least one package of the patch is installed. + */ + using sat::Solvable::isRelevant; public: const sat::Solvable & satSolvable() const { return *this; } Modified: trunk/libzypp/zypp/sat/Solvable.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Solvable.cc?rev=9500&r1=9499&r2=9500&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/Solvable.cc (original) +++ trunk/libzypp/zypp/sat/Solvable.cc Thu Apr 10 10:20:17 2008 @@ -393,6 +393,18 @@ return false; } + bool Solvable::isRelevant() const + { + NO_SOLVABLE_RETURN( false ); + if (isKind (ResKind::package)) + return true; // packages are always relevant + if (solvable_trivial_installable (_solvable, Pool::instance().systemRepo().get()) == -1) + return false; + else + return true; + } + + /////////////////////////////////////////////////////////////////// namespace { ///////////////////////////////////////////////////////////////// Modified: trunk/libzypp/zypp/sat/Solvable.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Solvable.h?rev=9500&r1=9499&r2=9500&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/Solvable.h (original) +++ trunk/libzypp/zypp/sat/Solvable.h Thu Apr 10 10:20:17 2008 @@ -182,6 +182,10 @@ bool isSatisfied() const; /** Returns true if the solvable is satisfied */ bool isBroken() const { return !isSatisfied(); } + /** Returns true if the solvable is relevant which means e.G. for patches + * that at least one package of the patch is installed. + */ + bool isRelevant() const; public: /** \name Locale support. */ -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org