Hi, On Mon, 11 Feb 2008, Stefan Schubert wrote:
I think I know. The code in question looks like so:
if (uninstalled->arch().compare( provider->arch() ) < 0) // provider has "better" arch, take it
The data in question is, that uninstalled has arch i586, provider has x86_64. So, i586->compare(x86_64), which is (Arch::compare just calls the below):
int compare( const CompatEntry & rhs ) const { if ( _compatScore != rhs._compatScore ) return( _compatScore < rhs._compatScore ? -1 : 1 ); return _archStr.compare( rhs._archStr ); }
The _compatScore is the number of archs compatible with it. Hence i586->compatScore is three, and x86_64->compatScore is six. Hence -1 is returned.
This is sort of true in the sense that more archs are compatible with "x86_64" than there are with "i585" (six vs. three). But of course it's the completely wrong mean to determine if x86_64 can and should replace a i586 package. It simply makes no sense to use Arch::compare() as a "better" predicate on archs.
Ciao, Michael.
Hm, I cannot find this code. Is it in zypper ?
libzypp. Arch::compare, Arch::CompatEntry::compare. The users are in solver/detail/Helper.cc:LookForUpdate::operator() and solver/detail/ResolverUpgrade.cc:Resolver::doUpgrade(). I've asked coolo to try the attached patch^Whack (it still wouldn't be completely correct, but at least it won't try to install incompatible candidates over already installed packages).
Some days ago I have run some testcases and no archtecture change has been done. So I am little bit confused.
Distupgrade algorithm with i586+x86_64 in a repository? With the sat branch code (AFAIK the old parser threw out incompatible architectures already when reading in)? Ciao, Michael. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org