Mailinglist Archive: zypp-devel (230 mails)

< Previous Next >
Re: [zypp-devel] zypper dup
  • From: Stefan Schubert <schubi@xxxxxxx>
  • Date: Mon, 11 Feb 2008 13:45:05 +0100
  • Message-id: <47B04351.4020704@xxxxxxx>
Michael Matz schrieb:
Hi,

On Mon, 11 Feb 2008, Michael Matz wrote:


It's the case that i586 is compatible for x86_64 as target. And the
Arch::compare looks for the compatible score first. So it's possible
that the callers of that compare function simply use it in the wrong
direction, or something like that.


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 ?

Some days ago I have run some testcases and no archtecture change has been
done. So I am little bit confused.

Greetings
Stefan

--
*******************************************************************************
Stefan Schubert
SUSE LINUX GmbH - Maxfeldstrasse 5 - D-90409 Nuernberg, Germany
e-mail: schubi@xxxxxxx
-------------------------------------------------------------------------------
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)


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

< Previous Next >
Follow Ups