+-------------------------------------------------------------------
+Fri Aug 25 13:05:33 CEST 2006 - schubi@suse.de
+
+- New behaviour in the solver: try with 'best' package first, try with 'all'
+ packages if this fails.
+ Bug :Bug 191983
+
-------------------------------------------------------------------
Fri Aug 25 11:35:48 CEST 2006 - dmacvicar@suse.de
--- /dev/null
+>!> Installing apache2-mod_python from channel sles10
+>!> Installing apache2-prefork from channel sles10
+>!> 1 problems found:
+>!> Problem:
+>!> Cannot install apache2-2.2.0-21.2.i586[sles10]
+>!> Can't install apache2-2.2.0-21.2.i586[sles10], since apache2-2.2.2-5.i586[stable] is already marked as needing to be installed
+>!> Solution:
+>!> do not install apache2-2.2.0-21.2.i586[sles10]
+>!>
+>!> Solution:
+>!> do not install apache2-2.2.2-5.i586[stable]
+>!>
+>!> Solution:
+>!> Ignore that apache2 is already set to install
+>!>
<trial>
<install channel="sles10" package="apache2-mod_python"/>
<install channel="sles10" package="apache2-prefork"/>
+ <reportproblems/>
</trial>
</test>
>!> install libapr-util1-1.2.2-13.2.i586[sles10]
>!> install libapr1-1.2.2-13.2.i586[sles10]
>!> installs=5, upgrades=0, uninstalls=0
->!> Solution #4:
->!> install apache2-2.2.0-21.2.i586[sles10]
->!> install apache2-mod_python-3.1.3-60.2.i586[sles10]
->!> install apache2-prefork-2.2.0-21.2.i586[sles10]
->!> install libapr-util1-1.2.7-3.i586[stable]
->!> install libapr1-1.2.2-13.2.i586[sles10]
->!> installs=5, upgrades=0, uninstalls=0
-#currently there is no fix available
-bug191983-bare-test.xml
-bug191983-test.xml
#have fix repo on machcd2
-bug186196-test.xml
\ No newline at end of file
+bug186196-test.xml
}
- // if we already have same name
- // check for better architecture, then edition
- // see yast2-pkg-bindings, Package.cc, ProvideProcess
-
- UniqMap::iterator upos = uniq.find( provider->name() );
- if (upos != uniq.end()) {
- if ((upos->second->arch().compare( provider->arch() ) < 0) // better arch
- || ((upos->second->arch().compare( provider->arch() ) == 0) // or same arch
- && (upos->second->edition().compare( provider->edition() ) < 0) ) ) // and better edition
- {
- // new provider is 'better'
-
- // erase the old provider
- for (PoolItemList::iterator it = providers.begin(); it != providers.end(); ++it) {
- if (*it == upos->second) {
- _XDEBUG("Kicking " << *it << " for " << provider)
- providers.erase( it );
- break;
- }
- }
- upos = uniq.end(); // trigger insertion of new provider below
+ if (!_context->tryAllPossibilities()) {
+ // if we already have same name
+ // check for better architecture, then edition
+ // see yast2-pkg-bindings, Package.cc, ProvideProcess
+
+ UniqMap::iterator upos = uniq.find( provider->name() );
+
+ if (upos != uniq.end()) {
+ if ((upos->second->arch().compare( provider->arch() ) < 0) // better arch
+ || ((upos->second->arch().compare( provider->arch() ) == 0) // or same arch
+ && (upos->second->edition().compare( provider->edition() ) < 0) ) ) // and better edition
+ {
+ // new provider is 'better'
+
+ // erase the old provider
+ for (PoolItemList::iterator it = providers.begin(); it != providers.end(); ++it) {
+ if (*it == upos->second) {
+ _context->setScippedPossibilities( true ); // Flag that there are other possibilities
+ // which we are currently ignore
+ _XDEBUG("Kicking " << *it << " for " << provider)
+ providers.erase( it );
+ break;
+ }
+ }
+ upos = uniq.end(); // trigger insertion of new provider below
+ }
}
- }
- if (upos == uniq.end()) {
+ if (upos == uniq.end()) {
+ providers.push_front( provider );
+ uniq[provider->name()] = provider;
+ }
+ } else {
+ // try all alternatives
providers.push_front( provider );
- uniq[provider->name()] = provider;
}
}
#include "zypp/ZYppFactory.h"
#include "zypp/SystemResObject.h"
-
+#define MAX_SECOND_RUNS 3
+#define TIMOUT_SECOND_RUN 30
/////////////////////////////////////////////////////////////////////////
namespace zypp
, _maxSolverPasses (0)
, _verifying (false)
, _testing (false)
+ , _tryAllPossibilities (false)
+ , _scippedPossibilities (false)
, _valid_solution_count (0)
, _best_context (NULL)
, _timed_out (false)
_best_context = NULL;
_timed_out = false;
+
+ _tryAllPossibilities = false;
+ _scippedPossibilities = false;
+
}
_ignoreArchitectureItem);
initial_queue->context()->setForceResolve( _forceResolve );
initial_queue->context()->setUpgradeMode( _upgradeMode );
+ initial_queue->context()->setTryAllPossibilities( _tryAllPossibilities );
+ initial_queue->context()->setScippedPossibilities( _scippedPossibilities );
/* If this is a verify, we do a "soft resolution" */
<< " / Prun " << (long) _pruned_queues.size()
<< " / Defr " << (long) _deferred_queues.size()
<< " / Invl " << (long) _invalid_queues.size() );
+
+
+ if ( !(_best_context && _best_context->isValid()) // no valid solution
+ && !_tryAllPossibilities ) { // a second run with ALL possibilities has not been tried
+
+ for (ResolverQueueList::iterator iter = _invalid_queues.begin();
+ iter != _invalid_queues.end(); iter++) {
+ // evaluate if there are other possibilities which have not been regarded
+ ResolverQueue_Ptr invalid = *iter;
+ if (invalid->context()->scippedPossibilities()) {
+ _scippedPossibilities = true;
+ break;
+ }
+ }
+
+ if (_scippedPossibilities) { // possible other solutions scipped
+ // lets try a second run with ALL possibilities
+ _tryAllPossibilities = true;
+ MIL << "================================================================"
+ << endl;
+ MIL << "No valid solution, lets try a second run with ALL possibilities"
+ << endl;
+ if (_maxSolverPasses <= 0)
+ _maxSolverPasses = MAX_SECOND_RUNS;
+ if (_timeout_seconds <= 0)
+ _timeout_seconds = TIMOUT_SECOND_RUN;
+
+ MIL << "But no longer than " << MAX_SECOND_RUNS << " runs or "
+ << TIMOUT_SECOND_RUN << " seconds" << endl;
+ MIL << "================================================================"
+ << endl;
+ // saving invalid queue
+ ResolverQueueList save_queues = _invalid_queues;
+ resolveDependencies ();
+ if (!(_best_context && _best_context->isValid()))
+ _invalid_queues = save_queues; // take the old
+ }
+ }
return _best_context && _best_context->isValid();
}
int _maxSolverPasses;
bool _verifying;
bool _testing;
+
+ // In order reducing solver time we are reducing the branches
+ // by skipping resolvables which have worse architecture,edition
+ // than a resolvable which provides the same cababilities.
+ // BUT if there is no valid solution we will regard the "other"
+ // resolvables in a second solver run too.
+ bool _tryAllPossibilities; // Try ALL alternatives
+ bool _scippedPossibilities;// Flag that there are other possibilities
+ // which we are currently ignore
// list populated by calls to addPoolItemTo*()
QueueItemList _initial_items;
, _architecture(arch)
, _forceResolve(false)
, _upgradeMode(false)
+ , _tryAllPossibilities(false)
+ , _scippedPossibilities(false)
{
_XDEBUG( "ResolverContext[" << this << "]::ResolverContext(" << parent << ")" );
_ignoreArchitectureItem = parent->_ignoreArchitectureItem;
_forceResolve = parent->_forceResolve;
_upgradeMode = parent->_upgradeMode;
+ _tryAllPossibilities = parent->_tryAllPossibilities;
+ _scippedPossibilities = parent->_scippedPossibilities;
+
} else {
_min_priority = MAXINT;
}
// This behaviour is favourited by ZMD
bool _upgradeMode; // Resolver has been called with doUpgrade
+ // In order reducing solver time we are reducing the branches
+ // by skipping resolvables which have worse architecture,edition
+ // than a resolvable which provides the same cababilities.
+ // BUT if there is no valid solution we will regard the "other"
+ // resolvables in a second solver run too.
+ bool _tryAllPossibilities; // Try ALL alternatives
+ bool _scippedPossibilities;// Flag that there are other possibilities
+ // which we are currently ignore
+
+
public:
ResolverContext (const ResPool & pool, const Arch & arch, ResolverContext_Ptr parent = NULL);
virtual ~ResolverContext();
bool verifying (void) const { return _verifying; }
void setVerifying (bool verifying) { _verifying = verifying; }
+ bool tryAllPossibilities (void) const { return _tryAllPossibilities; }
+ void setTryAllPossibilities (bool tryAllPossibilities) { _tryAllPossibilities = tryAllPossibilities; }
+
+ bool scippedPossibilities (void) const { return _scippedPossibilities; }
+ void setScippedPossibilities (bool scippedPossibilities) { _scippedPossibilities = scippedPossibilities; }
+
bool establishing (void) const { return _establishing; }
void setEstablishing (bool establishing) { _establishing = establishing; }