Author: mlandres
Date: Wed Aug 13 21:05:23 2008
New Revision: 10847
URL: http://svn.opensuse.org/viewcvs/zypp?rev=10847&view=rev
Log:
- Change Selectable API to support doing staus manipulation on
non-USER level.
Modified:
trunk/libzypp/VERSION.cmake
trunk/libzypp/devel/devel.ma/NewPool.cc
trunk/libzypp/package/libzypp.changes
trunk/libzypp/zypp/Product.h
trunk/libzypp/zypp/ui/Selectable.cc
trunk/libzypp/zypp/ui/Selectable.h
trunk/libzypp/zypp/ui/SelectableImpl.cc
trunk/libzypp/zypp/ui/SelectableImpl.h
trunk/libzypp/zypp/ui/SelectableTraits.h
Modified: trunk/libzypp/VERSION.cmake
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/VERSION.cmake?rev=10847&r1=10846&r2=10847&view=diff
==============================================================================
--- trunk/libzypp/VERSION.cmake (original)
+++ trunk/libzypp/VERSION.cmake Wed Aug 13 21:05:23 2008
@@ -59,10 +59,10 @@
# changes file. See './mkChangelog -h' for help.
#
SET(LIBZYPP_MAJOR "5")
-SET(LIBZYPP_COMPATMINOR "4")
+SET(LIBZYPP_COMPATMINOR "5")
SET(LIBZYPP_MINOR "5")
SET(LIBZYPP_PATCH "0")
#
-# LAST RELEASED: 5.4.0 (4)
+# LAST RELEASED: 5.5.0 (5)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
Modified: trunk/libzypp/devel/devel.ma/NewPool.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/NewPool.cc?rev=10847&r1=10846&r2=10847&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/NewPool.cc (original)
+++ trunk/libzypp/devel/devel.ma/NewPool.cc Wed Aug 13 21:05:23 2008
@@ -523,37 +523,6 @@
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
- // ResPool pool( ResPool::instance() );
-
- // Iterate all repositories loaded to the pool
- for_( it, pool.knownRepositoriesBegin(), pool.knownRepositoriesEnd() )
- {
- MIL << *it << endl;
- }
-
- // some specific repo
- Repository myRepo( *pool.knownRepositoriesBegin() );
-
- // Iterate all packages named "amarok" (from all repos)
- for_( it, pool.byIdentBegin( ResKind::package, "amarok" ), pool.byIdentEnd( ResKind::package, "amarok" ) )
- {
- MIL << "Check: " << *it << endl;
- if ( (*it)->repository() == myRepo )
- {
- MIL << " Found: " << (*it)->name() << endl;
- MIL << " Version: " << (*it)->edition() << endl;
- MIL << " Repository: " << (*it)->repository() << endl;
- }
-
- }
-
-
-
- ///////////////////////////////////////////////////////////////////
- INT << "===[END]============================================" << endl << endl;
- zypp::base::LogControl::instance().logNothing();
- return 0;
-
ui::Selectable::Ptr item( ui::Selectable::get( "amarok" ) );
item->setUpToDate();
Modified: trunk/libzypp/package/libzypp.changes
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=10847&r1=10846&r2=10847&view=diff
==============================================================================
--- trunk/libzypp/package/libzypp.changes (original)
+++ trunk/libzypp/package/libzypp.changes Wed Aug 13 21:05:23 2008
@@ -1,8 +1,15 @@
-------------------------------------------------------------------
+Wed Aug 13 21:01:25 CEST 2008 - ma@suse.de
+
+- Change Selectable API to support doing staus manipulation on
+ non-USER level.
+- revision 10847
+- version 5.5.0 (5)
+
+-------------------------------------------------------------------
Wed Aug 13 16:48:49 CEST 2008 - dmacvicar@suse.de
- support sat solver API for searching files
-- 5.5.0 (4)
-------------------------------------------------------------------
Wed Aug 13 15:12:45 CEST 2008 - ma@suse.de
Modified: trunk/libzypp/zypp/Product.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Product.h?rev=10847&r1=10846&r2=10847&view=diff
==============================================================================
--- trunk/libzypp/zypp/Product.h (original)
+++ trunk/libzypp/zypp/Product.h Wed Aug 13 21:05:23 2008
@@ -48,7 +48,7 @@
std::string flavor() const;
/** Get the product type (base, add-on) */
- std::string type() const;
+ std::string type() const ZYPP_DEPRECATED;
/** The URL to download the release notes for this product */
Url releaseNotesUrl() const;
@@ -79,13 +79,13 @@
std::string shortName() const;
/** Translated long name like <tt>SUSE Linux Enterprise Server 10</tt>*/
- std::string longName( const Locale & lang_r = Locale() ) const;
+ std::string longName( const Locale & lang_r = Locale() ) const ZYPP_DEPRECATED;
/** Vendor specific distribution id. */
- std::string distributionName() const;
+ std::string distributionName() const ZYPP_DEPRECATED;
/** Vendor specific distribution version. */
- Edition distributionEdition() const;
+ Edition distributionEdition() const ZYPP_DEPRECATED;
protected:
friend Ptr make<Self>( const sat::Solvable & solvable_r );
Modified: trunk/libzypp/zypp/ui/Selectable.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ui/Selectable.cc?rev=10847&r1=10846&r2=10847&view=diff
==============================================================================
--- trunk/libzypp/zypp/ui/Selectable.cc (original)
+++ trunk/libzypp/zypp/ui/Selectable.cc Wed Aug 13 21:05:23 2008
@@ -64,8 +64,8 @@
Status Selectable::status() const
{ return _pimpl->status(); }
- bool Selectable::setStatus( const Status state_r )
- { return _pimpl->setStatus( state_r ); }
+ bool Selectable::setStatus( const Status state_r, ResStatus::TransactByValue causer_r )
+ { return _pimpl->setStatus( state_r, causer_r ); }
PoolItem Selectable::installedObj() const
{ return _pimpl->installedObj(); }
@@ -164,46 +164,46 @@
return UNMODIFIED;
};
- bool Selectable::setFate( Fate fate_r )
+ bool Selectable::setFate( Fate fate_r, ResStatus::TransactByValue causer_r )
{
switch ( fate_r )
{
case TO_INSTALL:
- return setStatus( hasInstalledObj() ? S_Update : S_Install );
+ return setStatus( hasInstalledObj() ? S_Update : S_Install, causer_r );
break;
case TO_DELETE:
- return setStatus( S_Del );
+ return setStatus( S_Del, causer_r );
break;
case UNMODIFIED:
- return setStatus( hasInstalledObj() ? S_KeepInstalled : S_NoInst );
+ return setStatus( hasInstalledObj() ? S_KeepInstalled : S_NoInst, causer_r );
break;
}
return false;
}
- bool Selectable::setInstalled()
+ bool Selectable::setInstalled( ResStatus::TransactByValue causer_r )
{
- return( hasInstalledObj() || setStatus( S_Install ) );
+ return( hasInstalledObj() || setStatus( S_Install, causer_r ) );
}
- bool Selectable::setUpToDate()
+ bool Selectable::setUpToDate( ResStatus::TransactByValue causer_r )
{
if ( ! hasInstalledObj() )
- return setStatus( S_Install );
+ return setStatus( S_Install, causer_r );
PoolItem cand( candidateObj() );
if ( ! cand )
return true;
return( installedObj()->edition() >= cand->edition()
- || setStatus( S_Update ) );
+ || setStatus( S_Update, causer_r ) );
}
- bool Selectable::setDeleted()
+ bool Selectable::setDeleted( ResStatus::TransactByValue causer_r )
{
- return( ! hasInstalledObj() || setStatus( S_Del ) );
+ return( ! hasInstalledObj() || setStatus( S_Del, causer_r ) );
}
/******************************************************************
Modified: trunk/libzypp/zypp/ui/Selectable.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ui/Selectable.h?rev=10847&r1=10846&r2=10847&view=diff
==============================================================================
--- trunk/libzypp/zypp/ui/Selectable.h (original)
+++ trunk/libzypp/zypp/ui/Selectable.h Wed Aug 13 21:05:23 2008
@@ -38,13 +38,15 @@
//
/** Collects PoolItems of same kind and name.
*
- * Selectable is a status wrapper. That's why it offers the
- * PoolItems ResObjects but hides their individual ResStatus.
- * The ui::Status is calculated from (and transated to)
- * PoolItems individual ResStatus values.
+ * Selectable is a status wrapper. The ui::Status is calculated
+ * from (and transated to) \ref PoolItems individual \ref ResStatus
+ * values.
*
- * \note There's one Selectable per installed item, in case more
- * than one item is intalled.
+ * Available objects are sorted according the solver policies, 'best'
+ * packages first (e.g. by repository priority, then Arch, then Edition).
+ *
+ * Installed objects are sorted according the installation date, newer install
+ * time first.
*/
class Selectable : public base::ReferenceCounted, private base::NonCopyable
{
@@ -252,28 +254,28 @@
{ return fate() == TO_INSTALL; }
/** */
- bool setFate( Fate fate_r );
+ bool setFate( Fate fate_r, ResStatus::TransactByValue causer_r /*= ResStatus::USER*/ );
/** Set the item to be installed (new- or re-install). */
- bool setToInstall()
- { return setFate( TO_INSTALL ); }
+ bool setToInstall( ResStatus::TransactByValue causer_r /*= ResStatus::USER*/ )
+ { return setFate( TO_INSTALL, causer_r ); }
/** Take care the item gets installed if it is not. */
- bool setInstalled();
+ bool setInstalled( ResStatus::TransactByValue causer_r /*= ResStatus::USER*/ );
/** Take care the item gets installed if it is not, or is older. */
- bool setUpToDate();
+ bool setUpToDate( ResStatus::TransactByValue causer_r /*= ResStatus::USER*/ );
/** Set the item to be deleted (must be installed). */
- bool setToDelete()
- { return setFate( TO_DELETE ); }
+ bool setToDelete( ResStatus::TransactByValue causer_r /*= ResStatus::USER*/ )
+ { return setFate( TO_DELETE, causer_r ); }
/** Take care the item gets deleted if it is installed. */
- bool setDeleted();
+ bool setDeleted( ResStatus::TransactByValue causer_r /*= ResStatus::USER*/ );
/** Set the item to stay unmodified. */
- bool unset()
- { return setFate( UNMODIFIED ); }
+ bool unset( ResStatus::TransactByValue causer_r /*= ResStatus::USER*/ )
+ { return setFate( UNMODIFIED, causer_r ); }
//@}
public:
@@ -291,7 +293,7 @@
* Try to set a new Status.
* Returns \c false if the transitions is not allowed.
*/
- bool setStatus( const Status state_r );
+ bool setStatus( const Status state_r, ResStatus::TransactByValue causer_r /*= ResStatus::USER*/ );
/** Return who caused the modification. */
ResStatus::TransactByValue modifiedBy() const;
Modified: trunk/libzypp/zypp/ui/SelectableImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ui/SelectableImpl.cc?rev=10847&r1=10846&r2=10847&view=diff
==============================================================================
--- trunk/libzypp/zypp/ui/SelectableImpl.cc (original)
+++ trunk/libzypp/zypp/ui/SelectableImpl.cc Wed Aug 13 21:05:23 2008
@@ -196,7 +196,7 @@
return S_NoInst;
}
- bool Selectable::Impl::setStatus( const Status state_r )
+ bool Selectable::Impl::setStatus( const Status state_r, ResStatus::TransactByValue causer_r )
{
StatusHelper self( *this );
Modified: trunk/libzypp/zypp/ui/SelectableImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ui/SelectableImpl.h?rev=10847&r1=10846&r2=10847&view=diff
==============================================================================
--- trunk/libzypp/zypp/ui/SelectableImpl.h (original)
+++ trunk/libzypp/zypp/ui/SelectableImpl.h Wed Aug 13 21:05:23 2008
@@ -88,7 +88,7 @@
Status status() const;
/** */
- bool setStatus( const Status state_r );
+ bool setStatus( const Status state_r, ResStatus::TransactByValue causer_r );
/** Installed object. */
PoolItem installedObj() const
Modified: trunk/libzypp/zypp/ui/SelectableTraits.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ui/SelectableTraits.h?rev=10847&r1=10846&r2=10847&view=diff
==============================================================================
--- trunk/libzypp/zypp/ui/SelectableTraits.h (original)
+++ trunk/libzypp/zypp/ui/SelectableTraits.h Wed Aug 13 21:05:23 2008
@@ -67,10 +67,7 @@
};
/** Oder on InstalledItemSet.
- * \li repository priority
- * \li best Arch
- * \li best Edition
- * \li ResObject::constPtr as fallback.
+ * Newer install time at the beginning of the set.
*/
struct IOrder : public std::binary_function