projects
/
platform
/
upstream
/
libzypp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bd77232
)
added validate
author
Stefan Schubert
<schubi@suse.de>
Thu, 10 Apr 2008 10:01:13 +0000
(10:01 +0000)
committer
Stefan Schubert
<schubi@suse.de>
Thu, 10 Apr 2008 10:01:13 +0000
(10:01 +0000)
zypp/PoolItem.cc
patch
|
blob
|
history
zypp/PoolItem.h
patch
|
blob
|
history
zypp/Resolvable.h
patch
|
blob
|
history
zypp/sat/Solvable.cc
patch
|
blob
|
history
zypp/sat/Solvable.h
patch
|
blob
|
history
diff --git
a/zypp/PoolItem.cc
b/zypp/PoolItem.cc
index 0ccc861a95dedd6dbbe5fed18de37380e3a7bbc6..4850edb9cb7ae743265bc8ac95c529b760d48c3c 100644
(file)
--- a/
zypp/PoolItem.cc
+++ b/
zypp/PoolItem.cc
@@
-64,6
+64,11
@@
namespace zypp
return _resolvable->isRelevant();
}
return _resolvable->isRelevant();
}
+ bool validate() const
+ {
+ return _resolvable->validate();
+ }
+
private:
mutable ResStatus _status;
ResObject::constPtr _resolvable;
private:
mutable ResStatus _status;
ResObject::constPtr _resolvable;
diff --git
a/zypp/PoolItem.h
b/zypp/PoolItem.h
index 7abb2afd32f152eea667cbb157c1da08e59faa3e..acfc1e730004c9086e41a63a9aa45ccb2bd4d8f8 100644
(file)
--- a/
zypp/PoolItem.h
+++ b/
zypp/PoolItem.h
@@
-87,6
+87,12
@@
namespace zypp
*/
bool isRelevant() const;
*/
bool isRelevant() const;
+ /** Check if the solvable is satisfied,broken or not relevant
+ * (not important, so it can be ignored)
+ * \return BROKEN, SATISFIED, NOTRELEVANT
+ */
+ ValidValue validate() const;
+
public:
/** Return the \ref ResPool the item belongs to. */
ResPool pool() const;
public:
/** Return the \ref ResPool the item belongs to. */
ResPool pool() const;
diff --git
a/zypp/Resolvable.h
b/zypp/Resolvable.h
index 55d8f0f7f6ecadaf8ea43c13a39805e8a434e898..1be9cb1ae6142932a4a1aa284ee9c9258273b9f2 100644
(file)
--- a/
zypp/Resolvable.h
+++ b/
zypp/Resolvable.h
@@
-93,6
+93,12
@@
namespace zypp
*/
using sat::Solvable::isRelevant;
*/
using sat::Solvable::isRelevant;
+ /** Check if the solvable is satisfied,broken or not relevant
+ * (not important, so it can be ignored)
+ * \return BROKEN, SATISFIED, NOTRELEVANT
+ */
+ using sat::Solvable::validate;
+
public:
const sat::Solvable & satSolvable() const { return *this; }
public:
const sat::Solvable & satSolvable() const { return *this; }
diff --git
a/zypp/sat/Solvable.cc
b/zypp/sat/Solvable.cc
index 80d488b0cd74d938719c39705d5f9595a9a6776c..62ca70505b6eb1a5ada4ec9aec665d3d4a888a95 100644
(file)
--- a/
zypp/sat/Solvable.cc
+++ b/
zypp/sat/Solvable.cc
@@
-384,13
+384,21
@@
namespace zypp
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
+ ValidValue Solvable::validate() const
+ {
+ NO_SOLVABLE_RETURN( NOTRELEVANT );
+ int ret = solvable_trivial_installable (_solvable, Pool::instance().systemRepo().get());
+ if (ret == 0)
+ return BROKEN;
+ else if (ret > 0)
+ return SATISFIED;
+ else
+ return NOTRELEVANT;
+ }
+
bool Solvable::isSatisfied() const
{
bool Solvable::isSatisfied() const
{
- NO_SOLVABLE_RETURN( false );
- if (solvable_trivial_installable (_solvable, Pool::instance().systemRepo().get()) == 1)
- return true;
- else
- return false;
+ return validate() == SATISFIED;
}
bool Solvable::isRelevant() const
}
bool Solvable::isRelevant() const
@@
-398,10
+406,8
@@
namespace zypp
NO_SOLVABLE_RETURN( false );
if (isKind (ResKind::package))
return true; // packages are always relevant
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;
+
+ return validate() == BROKEN;
}
}
diff --git
a/zypp/sat/Solvable.h
b/zypp/sat/Solvable.h
index 6011c05556c83871d82a47df0bd918f6eea4d88c..b91ebbc66b5e150065a6c5090373a850e75fa8d1 100644
(file)
--- a/
zypp/sat/Solvable.h
+++ b/
zypp/sat/Solvable.h
@@
-34,6
+34,8
@@
namespace zypp
class CheckSum;
class OnMediaLocation;
class CheckSum;
class OnMediaLocation;
+ enum ValidValue { BROKEN, SATISFIED, NOTRELEVANT };
+
///////////////////////////////////////////////////////////////////
namespace sat
{ /////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
namespace sat
{ /////////////////////////////////////////////////////////////////
@@
-187,6
+189,13
@@
namespace zypp
*/
bool isRelevant() const;
*/
bool isRelevant() const;
+ /** Check if the solvable is satisfied,broken or not relevant
+ * (not important, so it can be ignored)
+ * \return BROKEN, SATISFIED, NOTRELEVANT
+ */
+
+ ValidValue validate() const;
+
public:
/** \name Locale support. */
//@{
public:
/** \name Locale support. */
//@{