Mailinglist Archive: yast-devel (191 mails)

< Previous Next >
[yast-devel] libzypp-4.6.1: Allow prioritizing repos.
  • From: Michael Andres <ma@xxxxxxx>
  • Date: Wed, 26 Mar 2008 17:57:06 +0100
  • Message-id: <20080326165706.GA7425@xxxxxxx>

JFYI: libzypp-4.6.1 now supports repo priorities.



/etc/zypp/repos.d
-----------------
Allow prioritizing repos (yum-priorities) by adding a line

priority=N

to the .repo file. Where N is an integer number from 1 (highest prio)
to 99 (least and default).



libzypp-4.6.1
-------------
The priority is stored in class zypp::RepoInfo:

namespace zypp
{
class RepoInfo
{
/**
* Repository priority for solver.
* Some number between 1 (highest priority) and 99 (defaultPriority).
*/
unsigned priority() const;
/**
* Set repository priority for solver.
* A newval_r of 0 sets the default priority.
*/
RepoInfo & setPriority( unsigned newval_r );





That's how you would e.g. change the priority of a repository in the pool:

Repository myfave( sat::Pool::instance().reposFind( "myfave" ) );
if ( myfave )
{
myfave.setInfo( myfave.info().setPriority( 2 ) );
}

--

cu,
Michael Andres

+------------------------------------------------------------------+
Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4
+------------------------------------------------------------------+
Michael Andres YaST Development ma@xxxxxxxxxx
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0
+------------------------------------------------------------------+

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

< Previous Next >
Follow Ups