Author: schubi2
Date: Wed Jan 23 14:22:24 2008
New Revision: 8346
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8346&view=rev
Log:
removing old solver
Modified:
branches/tmp/ma/jump_sat/libzypp/zypp/CMakeLists.txt
branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/InstallOrder.cc
branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/Resolver.h
branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/ResolverUpgrade.cc
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/CMakeLists.txt?rev=8346&r1=8345&r2=8346&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/CMakeLists.txt (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/CMakeLists.txt Wed Jan 23 14:22:24 2008
@@ -497,7 +497,7 @@
SET( zypp_solver_detail_SRCS
solver/detail/Helper.cc
-# solver/detail/InstallOrder.cc
+ solver/detail/InstallOrder.cc
solver/detail/ProblemSolutionIgnore.cc
solver/detail/ProblemSolutionInstall.cc
solver/detail/ProblemSolutionKeep.cc
@@ -505,7 +505,7 @@
solver/detail/ProblemSolutionUnlock.cc
solver/detail/ProblemSolutionCombi.cc
solver/detail/Resolver.cc
-# solver/detail/ResolverUpgrade.cc
+ solver/detail/ResolverUpgrade.cc
solver/detail/Resolver_problems.cc
solver/detail/SolutionAction.cc
solver/detail/Testcase.cc
@@ -513,7 +513,7 @@
SET( zypp_solver_detail_HEADERS
solver/detail/Helper.h
-# solver/detail/InstallOrder.h
+ solver/detail/InstallOrder.h
solver/detail/ProblemSolutionIgnore.h
solver/detail/ProblemSolutionInstall.h
solver/detail/ProblemSolutionKeep.h
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/InstallOrder.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/InstallOrder.cc?rev=8346&r1=8345&r2=8346&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/InstallOrder.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/InstallOrder.cc Wed Jan 23 14:22:24 2008
@@ -102,9 +102,6 @@
if (it->second.order == 0
&& it->second.item) // the default Nodes constructor leaves this empty
{
- if (isKind<SystemResObject>( it->second.item.resolvable() ))
- continue;
-
XXX << "InstallOrder::computeNextSet found " << ITEMNAME(it->second.item) << endl;
newlist.push_back(it->second.item);
@@ -227,7 +224,8 @@
_rdfstime++;
// items prereq
- Capabilities prq( item->dep(Dep::PREREQUIRES) );
+ Dependencies dependencies = item->deps();
+ CapabilitySet prq = dependencies[Dep::PREREQUIRES];
// an installed items prereq (in case they are reqired for uninstall scripts)
NameKindProxy nkp( _pool, item->name(), item->kind() );
if ( ! nkp.installedEmpty() )
@@ -237,7 +235,7 @@
}
// put prerequires first and requires last on list to ensure
// that prerequires are processed first
- for (Capabilities::const_iterator it = prq.begin(); it != prq.end(); ++it)
+ for (CapabilitySet::const_iterator it = prq.begin(); it != prq.end(); ++it)
{
requires.push_back(*it);
}
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/Resolver.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/Resolver.h?rev=8346&r1=8345&r2=8346&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/Resolver.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/Resolver.h Wed Jan 23 14:22:24 2008
@@ -66,7 +66,7 @@
ResPool _pool;
SATResolver *_satResolver;
SerialNumberWatcher _poolchanged;
-
+ bool _testing;
// list populated by calls to addPoolItemTo*()
PoolItemList _items_to_verify;
@@ -148,7 +148,7 @@
bool verifySystem ();
bool resolvePool();
- void doUpgrade( zypp::UpgradeStatistics & opt_stats_r ) {return;}; // FIXME
+ void doUpgrade( zypp::UpgradeStatistics & opt_stats_r );
PoolItemList problematicUpdateItems( void ) const { return _update_items; }
ResolverProblemList problems () const;
@@ -159,6 +159,9 @@
void reset (bool keepExtras = false );
+ bool testing(void) const { return _testing; }
+ void setTesting( bool testing ) { _testing = testing; }
+
};
///////////////////////////////////////////////////////////////////
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/ResolverUpgrade.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/ResolverUpgrade.cc?rev=8346&r1=8345&r2=8346&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/ResolverUpgrade.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/ResolverUpgrade.cc Wed Jan 23 14:22:24 2008
@@ -36,8 +36,6 @@
/-*/
#include "zypp/Capabilities.h"
-#include "zypp/capability/SplitCap.h"
-
#include "zypp/base/Logger.h"
#include "zypp/base/String.h"
#include "zypp/base/Gettext.h"
@@ -49,17 +47,12 @@
#include "zypp/ResFilters.h"
#include "zypp/CapFilters.h"
#include "zypp/Capability.h"
-#include "zypp/CapFactory.h"
#include "zypp/VendorAttr.h"
#include "zypp/Package.h"
-
-#include "zypp/capability/CapabilityImpl.h"
#include "zypp/ZYppFactory.h"
-
#include "zypp/solver/detail/Types.h"
#include "zypp/solver/detail/Helper.h"
#include "zypp/solver/detail/Resolver.h"
-
#include "zypp/Target.h"
/////////////////////////////////////////////////////////////////////////
@@ -74,8 +67,6 @@
using namespace std;
using namespace zypp;
-using zypp::capability::SplitCap;
-
/** Order on AvialableItemSet.
* \li best Arch
@@ -186,9 +177,7 @@
bool
Resolver::doesObsoleteItem (PoolItem_Ref candidate, PoolItem_Ref installed)
{
- CapFactory factory;
- Capability installedCap = factory.parse ( installed->kind(), installed->name(), Rel::EQ, installed->edition());
-
+ Capability installedCap( installed->name(), Rel::EQ, installed->edition(), installed->kind());
return doesObsoleteCapability (candidate, installedCap);
}
@@ -311,21 +300,15 @@
//
// DESCRIPTION : go through all installed (but not yet touched by user)
// packages and look for update candidates
-// handle splitprovides and replaced and dropped
//
void
Resolver::doUpgrade( UpgradeStatistics & opt_stats_r )
{
typedef map CandidateMap;
- typedef intrusive_ptr<const SplitCap> SplitCapPtr;
- typedef map SplitMap;
typedef map TodoMap;
CandidateMap candidatemap;
- SplitMap splitmap;
- TodoMap applyingSplits;
- TodoMap addSplitted;
TodoMap addProvided;
TodoMap addMultiProvided;
@@ -358,8 +341,6 @@
// Reset all auto states and build PoolItemOrderSet of available candidates
// (those that do not belong to PoolItems set to delete).
//
- // On the fly remember splitprovides and afterwards check, which
- // of them do apply.
///////////////////////////////////////////////////////////////////
PoolItemOrderSet available; // candidates available for install (no matter if selected for install or not)
@@ -442,32 +423,6 @@
available.insert( candidate );
MIL << "installed " << installed << ", candidate " << candidate << endl;
-
- // remember any splitprovides to packages actually installed.
- Capabilities caps = candidate->dep (Dep::PROVIDES);
- for (Capabilities::iterator cit = caps.begin(); cit != caps.end(); ++cit ) {
- if (isKindcapability::SplitCap( *cit ) ) {
-
- capability::CapabilityImpl::SplitInfo splitinfo = capability::CapabilityImpl::getSplitInfo( *cit );
-
- PoolItem splititem = Helper::findInstalledByNameAndKind (_pool, splitinfo.name, ResTraitszypp::Package::kind);
- MIL << "has split cap " << splitinfo.name << ":" << splitinfo.path << ", splititem:" << splititem << endl;
- if (splititem) {
- if (target) {
- ResObject::constPtr robj = target->whoOwnsFile( splitinfo.path );
- if (robj)
- MIL << "whoOwnsFile(): " << *robj << endl;
- if (robj
- && robj->name() == splitinfo.name)
- {
- MIL << "split matched !" << endl;
- splitmap[splititem].insert( candidate );
- }
- }
- }
- }
- }
-
} // iterate over the complete pool
// reset all seen (for next run)
@@ -479,26 +434,6 @@
MIL << "doUpgrade: " << opt_stats_r.pre_nocand << " packages without candidate (foreign, replaced or dropped)" << endl;
MIL << "doUpgrade: " << opt_stats_r.pre_avcand << " packages available for update" << endl;
- MIL << "doUpgrade: going to check " << splitmap.size() << " probably splitted packages" << endl;
- {
- ///////////////////////////////////////////////////////////////////
- // splitmap entries are gouped by PoolItems (we know this). So get the
- // filelist as a new PoolItem occures, and use it for consecutive entries.
- //
- // On the fly build SplitPkgMap from splits that do apply (i.e. file is
- // in PoolItems's filelist). The way splitmap was created, candidates added
- // are not initially tagged to delete!
- ///////////////////////////////////////////////////////////////////
-
- PoolItem_Ref citem;
-
- for ( SplitMap::iterator it = splitmap.begin(); it != splitmap.end(); ++it ) {
- applyingSplits[it->first].insert( it->second.begin(), it->second.end() );
- _DEBUG(" split count for " << it->first->name() << " now " << applyingSplits[it->first].size());
- }
- splitmap.clear();
- }
-
///////////////////////////////////////////////////////////////////
// Now iterate installed packages, not selected to delete, and
// figure out what might be an appropriate replacement. Current
@@ -595,8 +530,7 @@
// Remember new package for 2nd pass.
Dep dep (Dep::PROVIDES);
- CapFactory factory;
- Capability installedCap = factory.parse( installed->kind(), installed->name(), Rel::GE, installed->edition() );
+ Capability installedCap( installed->name(), Rel::EQ, installed->edition(), installed->kind());
FindProviders info(installed);
@@ -622,9 +556,6 @@
MIL << " only resolvable with other vendor found ==> do nothing" << endl;
} else {
MIL << " ==> (dropped)" << endl;
- // wait untill splits are processed. Might be a split obsoletes
- // this one (i.e. package replaced but not provided by new one).
- // otherwise it's finaly dropped.
probably_dropped = true;
}
break;
@@ -644,74 +575,6 @@
} // no candidate
- ///////////////////////////////////////////////////////////////////
- // anyway check for packages split off
- ///////////////////////////////////////////////////////////////////
-
- TodoMap::iterator sit = applyingSplits.find( installed );
- if ( sit != applyingSplits.end() ) {
- PoolItemOrderSet & toadd( sit->second );
- if ( !toadd.size() ) {
- INT << "Empty SplitPkgMap entry for " << installed << endl;
- } else {
- FindMap candidate;
- for ( PoolItemOrderSet::iterator ait = toadd.begin(); ait != toadd.end(); ++ait ) {
- PoolItem_Ref split_candidate = *ait;
- if ( probably_dropped
- && split_candidate.status().staysUninstalled()
- && doesObsoleteItem (split_candidate, installed))
- {
- probably_dropped = false;
- }
-
- FindMap::iterator itcandidate = candidate.find( split_candidate->name() );
-
- if (itcandidate != candidate.end()) { // split canidate with the same name found
- if (split_candidate.status().isToBeInstalled()
- || itcandidate->second.status().isToBeInstalled()) {
-
- if (split_candidate.status().isToBeInstalled()
- && itcandidate->second.status().isToBeInstalled()) {
- ERR << "only one should be set for installation: " << itcandidate->second << "; " << split_candidate << endl;
- } else {
- if (split_candidate.status().isToBeInstalled()) {
- itcandidate->second = split_candidate; // take thatone which is already set for installation
- }
- }
- } else {
- // not the same --> find better provider
- if (itcandidate->second->arch() != installed->arch()
- && split_candidate->arch() == installed->arch() ) {
- // prefer candidate which the same architecture as the installed item
- itcandidate->second = split_candidate;
- } else {
- int cmp = itcandidate->second->arch().compare( split_candidate->arch() );
- if (cmp < 0) { // new provider has better arch
- itcandidate->second = split_candidate;
- }
- else if (cmp == 0) { // new provider has equal arch
- if (itcandidate->second->edition().compare( split_candidate->edition() ) < 0) {
- itcandidate->second = split_candidate; // new provider has better edition
- }
- }
- }
- }
- }
- else {
- candidate[split_candidate->name()] = split_candidate;
- }
- }
-
- PoolItemOrderSet addcandidate;
- for (FindMap::iterator itcandidate = candidate.begin() ; itcandidate != candidate.end(); itcandidate++) {
- addcandidate.insert(itcandidate->second);
- MIL << " ==> ADD (splitted): " << itcandidate->second << endl;
- }
-
- addSplitted[installed] = addcandidate;
- }
- // count stats later
- }
///////////////////////////////////////////////////////////////////
// now handle dropped package
@@ -757,35 +620,6 @@
}
- // look at the split providers
-
- for ( TodoMap::iterator it = addSplitted.begin(); it != addSplitted.end(); ++it ) {
-
- PoolItemOrderSet & tset( it->second );
- PoolItem_Ref lastItem = PoolItem_Ref();
-
- for ( PoolItemOrderSet::iterator sit = tset.begin(); sit != tset.end(); ++sit ) {
- if (!lastItem
- || compareByN ( lastItem.resolvable(), sit->resolvable()) != 0) // do not install packages with the same NVR and other architecture
- {
- PoolItem_Ref item( *sit );
-
- // only install split if its actually a different edition
-
- PoolItem_Ref already_installed = Helper::findInstalledItem( _pool, item );
- if (!already_installed
- || already_installed->edition().compare( item->edition() ) != 0 )
- {
- if (setForInstallation (_pool, item)) {
- ++opt_stats_r.chk_add_split;
- }
- }
- }
- lastItem = *sit;
- }
-
- }
-
// look at the ones with multiple providers
for ( TodoMap::iterator it = addMultiProvided.begin(); it != addMultiProvided.end(); ++it ) {
@@ -795,29 +629,29 @@
PoolItemOrderSet & gset( it->second );
for ( PoolItemOrderSet::iterator git = gset.begin(); git != gset.end(); ++git ) {
- PoolItem_Ref item (*git);
+ PoolItem_Ref item (*git);
- if (git == gset.begin()) // default to first of set; the set is ordered, first is the best
- guess = item;
+ if (git == gset.begin()) // default to first of set; the set is ordered, first is the best
+ guess = item;
- if ( item.status().isToBeInstalled()) {
- MIL << " ==> (pass 2: meanwhile set to install): " << item << endl;
- if ( ! doesObsoleteItem (item, it->first ) ) {
- it->first.status().setToBeUninstalled( ResStatus::APPL_HIGH );
- }
- guess = PoolItem_Ref();
- break;
- } else {
- // Be prepared to guess.
- // Most common situation for guessing is something like:
- // qt-devel
- // qt-devel-experimental
- // qt-devel-japanese
- // That's why currently the shortest package name wins.
- if ( !guess || guess->name().size() > item->name().size() ) {
- guess = item;
+ if ( item.status().isToBeInstalled()) {
+ MIL << " ==> (pass 2: meanwhile set to install): " << item << endl;
+ if ( ! doesObsoleteItem (item, it->first ) ) {
+ it->first.status().setToBeUninstalled( ResStatus::APPL_HIGH );
+ }
+ guess = PoolItem_Ref();
+ break;
+ } else {
+ // Be prepared to guess.
+ // Most common situation for guessing is something like:
+ // qt-devel
+ // qt-devel-experimental
+ // qt-devel-japanese
+ // That's why currently the shortest package name wins.
+ if ( !guess || guess->name().size() > item->name().size() ) {
+ guess = item;
+ }
}
- }
}
if ( guess ) {
@@ -828,7 +662,8 @@
// is this a language package ?
for (Capabilities::const_iterator cit = freshens.begin(); cit != freshens.end(); ++cit) {
- if (cit->refers() == ResTraits<Language>::kind) {
+ string citName = cit->asString();
+ if (citName.length() > 7 && citName.compare(0, 7, "locale(") == 0) { // is a language dependency
requested_locale_match = true;
break;
}
@@ -857,7 +692,8 @@
// try to find a match of the locale freshens with one of the requested locales
for (Capabilities::const_iterator cit = freshens.begin(); cit != freshens.end(); ++cit) {
- if (cit->refers() == ResTraits<Language>::kind) {
+ string citName = cit->asString();
+ if (citName.length() > 7 && citName.compare(0, 7, "locale(") == 0) { // is a language dependency
string loc = cit->index();
MIL << "Look for language fallback " << loc << ":" << item << endl;
if (requested_locales.find( Locale( loc ) ) != requested_locales.end()) {
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org