ref: refs/heads/master
commit 12235269ee796068291a2dad4e5480aed1dbf097
Author: Michael Andres
Date: Fri Sep 4 12:19:24 2009 +0200
Lock rpms architecture only on distupgrade of the running system. (bnc #458520)
---
zypp/solver/detail/SATResolver.cc | 44 ++++++++++++------------------------
1 files changed, 15 insertions(+), 29 deletions(-)
diff --git a/zypp/solver/detail/SATResolver.cc b/zypp/solver/detail/SATResolver.cc
index 6439718..94f9fe4 100644
--- a/zypp/solver/detail/SATResolver.cc
+++ b/zypp/solver/detail/SATResolver.cc
@@ -1387,36 +1387,22 @@ void SATResolver::setSystemRequirements()
MIL << "SYSTEM Conflicts " << *iter << endl;
}
- // try to prefer none architecture change if possible
- // So the architecture of the "rpm" package should be prefered
-
- Capability cap("rpm");
- sat::WhatProvides rpmProviders(cap);
- for_( iter2, rpmProviders.begin(), rpmProviders.end() ) {
- if (iter2->isSystem()) {
- sat::detail::IdType nid = iter2->ident().id();
- nid = rel2id(_SATPool,
- nid,
- iter2->arch().id(), REL_ARCH, true);
- if (_distupgrade)
- {
- bool addRule = false;
- Capability cap(nid);
- sat::WhatProvides rpmProviders(cap);
- for_( iter3, rpmProviders.begin(), rpmProviders.end() ) {
- if ( !(iter3->isSystem())) {
- addRule = true;
- break;
- }
- }
- if (!addRule)
- break;
- }
+ // Lock the architecture of the running systems rpm
+ // package on distupgrade.
+ if ( _distupgrade && ZConfig::instance().systemRoot() == "/" )
+ {
+ ResPool pool( ResPool::instance() );
+ IdString rpm( "rpm" );
+ for_( it, pool.byIdentBegin(rpm), pool.byIdentEnd(rpm) )
+ {
+ if ( (*it)->isSystem() )
+ {
+ Capability archrule( (*it)->arch(), rpm.c_str(), Capability::PARSED );
+ queue_push( &(_jobQueue), SOLVER_INSTALL|SOLVABLE_NAME|SOLVER_ESSENTIAL );
+ queue_push( &(_jobQueue), archrule.id() );
- queue_push(&(_jobQueue), SOLVER_INSTALL|SOLVABLE_NAME|SOLVER_ESSENTIAL);
- queue_push(&(_jobQueue), nid);
- break;
- }
+ }
+ }
}
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org