Mailinglist Archive: zypp-commit (266 mails)

< Previous Next >
[zypp-commit] r11800 - in /trunk/libzypp/zypp: Resolver.cc TriBool.h solver/detail/Resolver.cc
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Tue, 25 Nov 2008 15:24:31 -0000
  • Message-id: <20081125152431.D8B81FB92A@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Tue Nov 25 16:24:31 2008
New Revision: 11800

URL: http://svn.opensuse.org/viewcvs/zypp?rev=11800&view=rev
Log:
- Fix TriBool usage in Resolver.
- Add CodePitfalls page to doc and mention TriBool there.

Modified:
trunk/libzypp/zypp/Resolver.cc
trunk/libzypp/zypp/TriBool.h
trunk/libzypp/zypp/solver/detail/Resolver.cc

Modified: trunk/libzypp/zypp/Resolver.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Resolver.cc?rev=11800&r1=11799&r2=11800&view=diff
==============================================================================
--- trunk/libzypp/zypp/Resolver.cc (original)
+++ trunk/libzypp/zypp/Resolver.cc Tue Nov 25 16:24:31 2008
@@ -25,7 +25,7 @@
{ /////////////////////////////////////////////////////////////////

using namespace solver;
-
+
IMPL_PTR_TYPE(Resolver);
#if 0
Resolver_Ptr Resolver::_resolver = NULL;
@@ -65,17 +65,17 @@
bool Resolver::resolvePool ()
{ return _pimpl->resolvePool(); }
bool Resolver::resolveQueue (zypp::solver::detail::SolverQueueItemList &
queue)
- { return _pimpl->resolveQueue(queue); }
+ { return _pimpl->resolveQueue(queue); }
void Resolver::undo()
{ _pimpl->undo(); }
ResolverProblemList Resolver::problems ()
{ return _pimpl->problems (); }
void Resolver::applySolutions( const ProblemSolutionList & solutions )
- { _pimpl->applySolutions (solutions); }
+ { _pimpl->applySolutions (solutions); }
bool Resolver::doUpgrade( UpgradeStatistics & opt_stats_r )
{ return _pimpl->doUpgrade(opt_stats_r); }
void Resolver::doUpdate()
- { _pimpl->doUpdate(); }
+ { _pimpl->doUpdate(); }
void Resolver::setForceResolve( const bool force )
{ _pimpl->setForceResolve( force ); }
bool Resolver::forceResolve()
@@ -84,19 +84,19 @@
(const bool ignoreAlreadyRecommended)
{ _pimpl->setIgnorealreadyrecommended (ignoreAlreadyRecommended); }
bool Resolver::ignoreAlreadyRecommended()
- { return _pimpl->ignorealreadyrecommended(); }
+ { return _pimpl->ignorealreadyrecommended(); }
void Resolver::setOnlyRequires( const bool onlyRequires )
{ onlyRequires ? _pimpl->setOnlyRequires( true ) : _pimpl->setOnlyRequires(
false ); }
void Resolver::resetOnlyRequires()
- { _pimpl->setOnlyRequires( indeterminate ); }
+ { _pimpl->setOnlyRequires( indeterminate ); }
bool Resolver::onlyRequires()
{
- if (_pimpl->onlyRequires() == indeterminate)
+ if (indeterminate(_pimpl->onlyRequires()))
return ZConfig::instance().solver_onlyRequires();
else
return _pimpl->onlyRequires();
}
-
+
void Resolver::addRequire (const Capability & capability)
{ _pimpl->addExtraRequire( capability ); }
void Resolver::addConflict (const Capability & capability)
@@ -108,7 +108,7 @@
const CapabilitySet Resolver::getRequire ()
{ return _pimpl->extraRequires();}
const CapabilitySet Resolver::getConflict ()
- { return _pimpl->extraConflicts();}
+ { return _pimpl->extraConflicts();}
std::list<PoolItem> Resolver::problematicUpdateItems( void ) const
{ return _pimpl->problematicUpdateItems(); }
bool Resolver::createSolverTestcase (const std::string & dumpPath)
@@ -121,8 +121,8 @@
const solver::detail::ItemCapKindList Resolver::satifiedByInstalled (const
PoolItem item)
{ return _pimpl->satifiedByInstalled (item); }
const solver::detail::ItemCapKindList Resolver::installedSatisfied (const
PoolItem item)
- { return _pimpl->installedSatisfied (item); }
-
+ { return _pimpl->installedSatisfied (item); }
+


/////////////////////////////////////////////////////////////////

Modified: trunk/libzypp/zypp/TriBool.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/TriBool.h?rev=11800&r1=11799&r2=11800&view=diff
==============================================================================
--- trunk/libzypp/zypp/TriBool.h (original)
+++ trunk/libzypp/zypp/TriBool.h Tue Nov 25 16:24:31 2008
@@ -30,7 +30,7 @@
* \endcode
*
* \warning Be carefull.esp. when comparing \ref TriBool using
- * \c operator==, as <b><tt>( indeterminate == indeterminate )</tt><b>
+ * \c operator==, as <b><tt>( indeterminate == indeterminate )</tt></b>
* does \b not evaluate \b true. It's \c indeterminate.
*
* \see http://www.boost.org/doc/html/tribool.html

Modified: trunk/libzypp/zypp/solver/detail/Resolver.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Resolver.cc?rev=11800&r1=11799&r2=11800&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/Resolver.cc (original)
+++ trunk/libzypp/zypp/solver/detail/Resolver.cc Tue Nov 25 16:24:31 2008
@@ -72,7 +72,7 @@
, _testing(false)
, _forceResolve(false)
, _upgradeMode(false)
- , _updateMode(false)
+ , _updateMode(false)
, _verifying(false)
, _onlyRequires(indeterminate)
, _ignorealreadyrecommended(false)
@@ -98,7 +98,7 @@
void
Resolver::reset (bool keepExtras )
{
- _verifying = false;
+ _verifying = false;

if (!keepExtras) {
_extra_requires.clear();
@@ -175,7 +175,7 @@
if (!found) {
_added_queue_items.push_back (item);
_added_queue_items.unique ();
- }
+ }
}

void
@@ -222,8 +222,8 @@
UndoTransact resetting (ResStatus::APPL_HIGH);

_DEBUG ("Resolver::verifySystem() ");
-
- _verifying = true;
+
+ _verifying = true;

invokeOnEach ( _pool.begin(), _pool.end(),
resfilter::ByTransact( ), // Resetting
all transcations
@@ -249,7 +249,7 @@

// Additional QueueItems which has to be regarded by the solver
_removed_queue_items.clear();
- _added_queue_items.clear();
+ _added_queue_items.clear();

return;
}
@@ -271,7 +271,7 @@
}

_satResolver->setFixsystem(false);
- _satResolver->setIgnorealreadyrecommended(false);
+ _satResolver->setIgnorealreadyrecommended(false);
_satResolver->setAllowdowngrade(false);
_satResolver->setAllowarchchange(false);
_satResolver->setAllowvendorchange(false);
@@ -280,7 +280,7 @@
_satResolver->setAllowvirtualconflicts(false);
_satResolver->setNoupdateprovide(false);
_satResolver->setDosplitprovides(false);
-
+
if (_upgradeMode) {
_satResolver->setAllowdowngrade(true);
_satResolver->setUpdatesystem(false); // not needed cause packages has
already been evaluteted by distupgrade
@@ -298,8 +298,8 @@

if (_forceResolve)
_satResolver->setAllowuninstall(true);
-
- if (_onlyRequires == indeterminate)
+
+ if (indeterminate(_onlyRequires))

_satResolver->setOnlyRequires(ZConfig::instance().solver_onlyRequires());
else if (_onlyRequires)
_satResolver->setOnlyRequires(true);
@@ -310,7 +310,7 @@
_satResolver->setFixsystem(true);

if (_ignorealreadyrecommended)
- _satResolver->setIgnorealreadyrecommended(true);
+ _satResolver->setIgnorealreadyrecommended(true);

// Resetting additional solver information
_isInstalledBy.clear();
@@ -330,16 +330,16 @@
Resolver::resolveQueue(solver::detail::SolverQueueItemList & queue)
{
solverInit();
-
+
// add/remove additional SolverQueueItems
for (SolverQueueItemList::const_iterator iter =
_removed_queue_items.begin();
iter != _removed_queue_items.end(); iter++) {
for (SolverQueueItemList::const_iterator iterQueue = queue.begin();
iterQueue != queue.end(); iterQueue++) {
- if ( (*iterQueue)->cmp(*iter) == 0) {
+ if ( (*iterQueue)->cmp(*iter) == 0) {
MIL << "remove from queue" << *iter;
queue.remove(*iterQueue);
break;
- }
+ }
}
}

@@ -350,10 +350,10 @@
if ( (*iterQueue)->cmp(*iter) == 0) {
found = true;
break;
- }
+ }
}
if (!found) {
- MIL << "add to queue" << *iter;
+ MIL << "add to queue" << *iter;
queue.push_back(*iter);
}
}
@@ -362,7 +362,7 @@
// give the user a chance for changing these decisions again.
_removed_queue_items.clear();
_added_queue_items.clear();
-
+
return _satResolver->resolveQueue(queue, _addWeak);
}

@@ -389,7 +389,7 @@
sat::WhatProvides possibleProviders(*capIt);
for_( iter, possibleProviders.begin(), possibleProviders.end()
) {
PoolItem provider = ResPool::instance().find( *iter );
-
+
// searching if this provider will already be installed
bool found = false;
bool alreadySetForInstallation = false;
@@ -410,19 +410,19 @@
_isInstalledBy.insert (make_pair( provider,
capKindisInstalledBy));
} else {
// no initial installation cause it has been set be
e.g. user
- ItemCapKind capKindisInstalledBy( *instIter,
*capIt, Dep::REQUIRES, false );
- _isInstalledBy.insert (make_pair( provider,
capKindisInstalledBy));
+ ItemCapKind capKindisInstalledBy( *instIter,
*capIt, Dep::REQUIRES, false );
+ _isInstalledBy.insert (make_pair( provider,
capKindisInstalledBy));
}
ItemCapKind capKindisInstalledBy( provider, *capIt,
Dep::REQUIRES, !alreadySetForInstallation );
- _installs.insert (make_pair( *instIter,
capKindisInstalledBy));
+ _installs.insert (make_pair( *instIter,
capKindisInstalledBy));
}

if (provider.status().staysInstalled()) { // Is already
satisfied by an item which is installed
ItemCapKind capKindisInstalledBy( provider, *capIt,
Dep::REQUIRES, false );
_satifiedByInstalled.insert (make_pair( *instIter,
capKindisInstalledBy));

- ItemCapKind installedSatisfied( *instIter, *capIt,
Dep::REQUIRES, false );
- _installedSatisfied.insert (make_pair( provider,
installedSatisfied));
+ ItemCapKind installedSatisfied( *instIter, *capIt,
Dep::REQUIRES, false );
+ _installedSatisfied.insert (make_pair( provider,
installedSatisfied));
}
}
}
@@ -434,7 +434,7 @@
sat::WhatProvides possibleProviders(*capIt);
for_( iter, possibleProviders.begin(),
possibleProviders.end() ) {
PoolItem provider = ResPool::instance().find( *iter );
-
+
// searching if this provider will already be installed
bool found = false;
bool alreadySetForInstallation = false;
@@ -455,20 +455,20 @@
_isInstalledBy.insert (make_pair( provider,
capKindisInstalledBy));
} else {
// no initial installation cause it has been
set be e.g. user
- ItemCapKind capKindisInstalledBy( *instIter,
*capIt, Dep::RECOMMENDS, false );
- _isInstalledBy.insert (make_pair( provider,
capKindisInstalledBy));
+ ItemCapKind capKindisInstalledBy( *instIter,
*capIt, Dep::RECOMMENDS, false );
+ _isInstalledBy.insert (make_pair( provider,
capKindisInstalledBy));
}
ItemCapKind capKindisInstalledBy( provider, *capIt,
Dep::RECOMMENDS, !alreadySetForInstallation );
- _installs.insert (make_pair( *instIter,
capKindisInstalledBy));
+ _installs.insert (make_pair( *instIter,
capKindisInstalledBy));
}

if (provider.status().staysInstalled()) { // Is already
satisfied by an item which is installed
ItemCapKind capKindisInstalledBy( provider, *capIt,
Dep::RECOMMENDS, false );
_satifiedByInstalled.insert (make_pair( *instIter,
capKindisInstalledBy));

- ItemCapKind installedSatisfied( *instIter, *capIt,
Dep::RECOMMENDS, false );
- _installedSatisfied.insert (make_pair( provider,
installedSatisfied));
- }
+ ItemCapKind installedSatisfied( *instIter, *capIt,
Dep::RECOMMENDS, false );
+ _installedSatisfied.insert (make_pair( provider,
installedSatisfied));
+ }
}
}

@@ -498,8 +498,8 @@
_isInstalledBy.insert (make_pair( *instIter,
capKindisInstalledBy));
} else {
// no initial installation cause it has been
set be e.g. user
- ItemCapKind capKindisInstalledBy( provider,
*capIt, Dep::SUPPLEMENTS, false );
- _isInstalledBy.insert (make_pair( *instIter,
capKindisInstalledBy));
+ ItemCapKind capKindisInstalledBy( provider,
*capIt, Dep::SUPPLEMENTS, false );
+ _isInstalledBy.insert (make_pair( *instIter,
capKindisInstalledBy));
}
ItemCapKind capKindisInstalledBy( *instIter,
*capIt, Dep::SUPPLEMENTS, !alreadySetForInstallation );
_installs.insert (make_pair( provider,
capKindisInstalledBy));
@@ -509,8 +509,8 @@
ItemCapKind capKindisInstalledBy( *instIter,
*capIt, Dep::SUPPLEMENTS, !alreadySetForInstallation );
_satifiedByInstalled.insert (make_pair( provider,
capKindisInstalledBy));

- ItemCapKind installedSatisfied( provider, *capIt,
Dep::SUPPLEMENTS, false );
- _installedSatisfied.insert (make_pair( *instIter,
installedSatisfied));
+ ItemCapKind installedSatisfied( provider, *capIt,
Dep::SUPPLEMENTS, false );
+ _installedSatisfied.insert (make_pair( *instIter,
installedSatisfied));
}
}
}

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages