From f6d77d0c96e45fe22d93650fe87e041dea3cd8cd Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Thu, 31 Jul 2008 17:05:12 +0000 Subject: [PATCH] - Follow solver policy and make repository priority the highest key, when ordering packages. Then architecture, and edition last. --- package/libzypp.changes | 7 +++++++ zypp/ui/SelectableTraits.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/package/libzypp.changes b/package/libzypp.changes index 0c24064..99fcc1a 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Jul 31 19:01:14 CEST 2008 ma@suse.de + +- Follow solver policy and make repository priority the highest + key, when ordering packages. Then architecture, and edition last. +- revision 10710 + +------------------------------------------------------------------- Wed Jul 30 19:12:00 CEST 2008 ma@suse.de - /var/lib/zypp and /var/cache/zypp should be owned by libzypp diff --git a/zypp/ui/SelectableTraits.h b/zypp/ui/SelectableTraits.h index 6ac9881..29ffe69 100644 --- a/zypp/ui/SelectableTraits.h +++ b/zypp/ui/SelectableTraits.h @@ -33,6 +33,7 @@ namespace zypp struct SelectableTraits { /** Oder on AvalableItemSet. + * \li repository priority * \li best Arch * \li best Edition * \li ResObject::constPtr as fallback. @@ -46,6 +47,10 @@ namespace zypp // bool operator()( const PoolItem & lhs, const PoolItem & rhs ) const { + unsigned lprio = lhs->satSolvable().repository().info().priority(); + unsigned rprio = rhs->satSolvable().repository().info().priority(); + if ( lprio != rprio ) + return( lprio < rprio ); // lower value meands higher priority :( int res = lhs->arch().compare( rhs->arch() ); if ( res ) return res > 0; -- 2.7.4