Mailinglist Archive: zypp-commit (96 mails)

< Previous Next >
[zypp-commit] <libzypp> master : Provide Selectable::identicalAvailable as counterpart to identicalInstalled.
  • From: Michael Andres <ma@xxxxxxx>
  • Date: Wed, 2 Dec 2009 18:28:59 +0100
  • Message-id: <E1NFt4x-0007cz-BV@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 581be44031563236039dd1f16d147ddc5eb6a8e6
Author: Michael Andres <ma@xxxxxxx>
Date: Wed Dec 2 18:28:59 2009 +0100

Provide Selectable::identicalAvailable as counterpart to identicalInstalled.
---
zypp/ui/Selectable.cc | 3 +++
zypp/ui/Selectable.h | 10 ++++++++--
zypp/ui/SelectableImpl.h | 20 ++++++++++++++++----
3 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/zypp/ui/Selectable.cc b/zypp/ui/Selectable.cc
index 6283a17..23e2e19 100644
--- a/zypp/ui/Selectable.cc
+++ b/zypp/ui/Selectable.cc
@@ -82,6 +82,9 @@ namespace zypp
PoolItem Selectable::highestAvailableVersionObj() const
{ return _pimpl->highestAvailableVersionObj(); }

+ bool Selectable::identicalAvailable( const PoolItem & rhs ) const
+ { return _pimpl->identicalAvailable( rhs ); }
+
bool Selectable::identicalInstalled( const PoolItem & rhs ) const
{ return _pimpl->identicalInstalled( rhs ); }

diff --git a/zypp/ui/Selectable.h b/zypp/ui/Selectable.h
index 875e086..9be8a75 100644
--- a/zypp/ui/Selectable.h
+++ b/zypp/ui/Selectable.h
@@ -147,8 +147,14 @@ namespace zypp
*/
PoolItem highestAvailableVersionObj() const;

- /** \c True if \a rhs has the same content as an installed one.
- * Basically the same name, edition, arch, vendor and buildtime.
+ /** \c True if \a rhs is installed and one with the same content is
available.
+ * Basically the same name, edition, arch, vendor and buildtime.
+ * \see \ref sat::Solvable::identical
+ */
+ bool identicalAvailable( const PoolItem & rhs ) const;
+
+ /** \c True if \a rhs has the same content as an installed one.
+ * Basically the same name, edition, arch, vendor and buildtime.
* \see \ref sat::Solvable::identical
*/
bool identicalInstalled( const PoolItem & rhs ) const;
diff --git a/zypp/ui/SelectableImpl.h b/zypp/ui/SelectableImpl.h
index ef71ef7..85ec1a3 100644
--- a/zypp/ui/SelectableImpl.h
+++ b/zypp/ui/SelectableImpl.h
@@ -168,7 +168,7 @@ namespace zypp
return _defaultCandidate;
}

- /** \copydoc Selectable::highestAvailableVersionObj() */
+ /** \copydoc Selectable::highestAvailableVersionObj()const */
PoolItem highestAvailableVersionObj() const
{
PoolItem ret;
@@ -180,9 +180,21 @@ namespace zypp
return ret;
}

- /** \c True if \a rhs has the same content as an installed one.
- * \see \ref sat::Solvable::identical
- */
+ /** \copydoc Selectable::identicalAvailable( const PoolItem & )const */
+ bool identicalAvailable( const PoolItem & rhs ) const
+ {
+ if ( !availableEmpty() && rhs )
+ {
+ for_( it, _availableItems.begin(), _availableItems.end() )
+ {
+ if ( identical( *it, rhs ) )
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /** \copydoc Selectable::identicalInstalled( const PoolItem & )const */
bool identicalInstalled( const PoolItem & rhs ) const
{
if ( !installedEmpty() && rhs )
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages