[zypp-devel] libzypp-4.6.1: Allow prioritizing repos.
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@novell.com 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: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Michael Andres wrote:
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).
Nice, i'll add --set-priority to the modifyrepo command of zypper :O) jano -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Jan Kupec wrote:
Michael Andres wrote:
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).
Nice, i'll add --set-priority to the modifyrepo command of zypper :O)
jano
Oh yes, i have it in my bugzilla already :O) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Jan Kupec wrote:
Nice, i'll add --set-priority to the modifyrepo command of zypper :O)
jano
For setting auto refresh it is mr -r, --refresh and not --set-auto-refresh so stick to one style please. mr --priority would be in this case or? Duncan -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Duncan Mac-Vicar Prett wrote:
Jan Kupec wrote:
Nice, i'll add --set-priority to the modifyrepo command of zypper :O)
jano
For setting auto refresh it is mr -r, --refresh and not --set-auto-refresh so stick to one style please. mr --priority would be in this case or?
Of course, i agree, that was just a quick proposal. j. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Michael Andres napsal(a):
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).
That's great, but ... ehm... what does it mean? I mean does it influence the solver or downloading a package in commit? Example situation: repository X with priority 99 containing package foo-1.0 repository Y with priority 90 containing package foo-0.9 repository Z with priority 95 containing package foo-1.0 User selects foo for installation. Which package will be installed? And what users expect to happen when they change priority of a repository? -- Best Regards Ladislav Slezák Yast Developer ------------------------------------------------------------------------ SUSE LINUX, s.r.o. e-mail: lslezak@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Prague 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
That's great, but ... ehm... what does it mean? I mean does it influence the solver or downloading a package in commit?
Example situation: repository X with priority 99 containing package foo-1.0 repository Y with priority 90 containing package foo-0.9 repository Z with priority 95 containing package foo-1.0
User selects foo for installation. Which package will be installed?
And what users expect to happen when they change priority of a repository? I don't think the solver is influenced yet.
Duncan -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
* Duncan Mac-Vicar Prett
Example situation: repository X with priority 99 containing package foo-1.0 repository Y with priority 90 containing package foo-0.9 repository Z with priority 95 containing package foo-1.0
I don't think the solver is influenced yet.
Well, it should IMHO. Since it helps the solver to decide whats a 'best' package is: repository openSUSE with priority 99 containing package foo-0.9-stable repository Experimental with priority 50 containing package foo-1.1-unstable An innocent user requesting the installation of 'foo' should get foo-0.9, since its probably the 'best' from a distribution and maintenance/support perspective. An experienced user might want to change priorities, willing to take the risk of a 'leading edge' version of 'foo'.
From my POV, this is the whole point of having repository priorities.
Klaus -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On 3/27/2008 at 16:12, Klaus Kaempf
wrote: Well, it should IMHO. Since it helps the solver to decide whats a 'best' package is: repository openSUSE with priority 99 containing package foo-0.9-stable repository Experimental with priority 50 containing package foo-1.1-unstable
Klaus, your example inverted the priorities. As per the original announcement, 99 is 'lowest priority'
to the .repo file. Where N is an integer number from 1 (highest prio) to 99 (least and default).
Dominique -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
* Dominique Leuenberger
On 3/27/2008 at 16:12, Klaus Kaempf
wrote: Well, it should IMHO. Since it helps the solver to decide whats a 'best' package is: repository openSUSE with priority 99 containing package foo-0.9-stable repository Experimental with priority 50 containing package foo-1.1-unstable
Klaus, your example inverted the priorities. As per the original announcement, 99 is 'lowest priority'
Ouch ! Thanks for pointing this out.
to the .repo file. Where N is an integer number from 1 (highest prio) to 99 (least and default).
I wonder if this followes the 'principle of least surprise'. Apparently, it didn't for me :-} Klaus -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Klaus Kaempf wrote:
I wonder if this followes the 'principle of least surprise'. Apparently, it didn't for me :-}
Klaus
No, the principle of least surprise is invalidated if a existing (implicit) standard exists which does not follow it: http://wiki.centos.org/PackageManagement/Yum/Priorities ;-) Duncan -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
to the .repo file. Where N is an integer number from 1 (highest prio) to 99 (least and default) Well, IMHO the UI should talk about high, low, medium, and even zypper should accept this kind of input (apart of numbers). Numbers are for
Dominique Leuenberger wrote: those editing the .conf file Duncan -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Duncan Mac-Vicar Prett wrote:
to the .repo file. Where N is an integer number from 1 (highest prio) to 99 (least and default) Well, IMHO the UI should talk about high, low, medium, and even zypper should accept this kind of input (apart of numbers). Numbers are for
Dominique Leuenberger wrote: those editing the .conf file
If we agree on this, then let's do this using an enum provided in libzypp. I agree, but there should be cca (or at least) 5 levels i guess. jano -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Klaus Kaempf wrote:
Well, it should IMHO. Since it helps the solver to decide whats a 'best' package is:
repository openSUSE with priority 99 containing package foo-0.9-stable repository Experimental with priority 50 containing package foo-1.1-unstable
An innocent user requesting the installation of 'foo' should get foo-0.9, since its probably the 'best' from a distribution and maintenance/support perspective.
An experienced user might want to change priorities, willing to take the risk of a 'leading edge' version of 'foo'.
From my POV, this is the whole point of having repository priorities.
Klaus
Of course, we did not add support in libzypp API just to decorate the header file, but this has to be implemented as a solver policy and that code is missing, and we have enough homework for the rest of the week ;-) Duncan -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Thu, Mar 27, Duncan Mac-Vicar Prett wrote:
That's great, but ... ehm... what does it mean? I mean does it influence the solver or downloading a package in commit?
It influences the solver. The solver will prefer packages from repos with higher priority (which unfortunately is a lower number in yum-speak). Michael <mls> should be able to provide the exact details. AFAIK higher repo priority is prefered over version and arch.
Example situation: repository X with priority 99 containing package foo-1.0 repository Y with priority 90 containing package foo-0.9 repository Z with priority 95 containing package foo-1.0
User selects foo for installation. Which package will be installed?
AFAIK packages will be considered in this order a) package foo-0.9 (priority 90) b) package foo-1.0 (priority 95) c) package foo-1.0 (priority 99) but architecture/vendor of any installed foo may have an influence.
And what users expect to happen when they change priority of a repository? I don't think the solver is influenced yet.
No it works, and if something is wrong with it, it's missconfigured or a solver bug :) -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com 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: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Michael Andres wrote:
No it works, and if something is wrong with it, it's missconfigured or a solver bug :)
Wow! amazing, I thought the connection with solver's code is there, and what I told to Klaus is not true :-) Duncan -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
* Michael Andres
AFAIK packages will be considered in this order
a) package foo-0.9 (priority 90) b) package foo-1.0 (priority 95) c) package foo-1.0 (priority 99)
but architecture/vendor of any installed foo may have an influence.
Just to make the picture complete (or raise the confusion ?), it should be mentioned that we intend to make all 'solver decisions' configurable through a policy plugin. Details have yet to be fleshed out ... Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On 3/27/2008 at 15:25, Ladislav Slezak
wrote: to the .repo file. Where N is an integer number from 1 (highest prio) to 99 (least and default). That's great, but ... ehm... what does it mean? I mean does it influence the
solver or downloading a package in commit?
Example situation: repository X with priority 99 containing package foo-1.0 repository Y with priority 90 containing package foo-0.9 repository Z with priority 95 containing package foo-1.0
User selects foo for installation. Which package will be installed?
And what users expect to happen when they change priority of a repository?
ACtually a very interesting question. Me, as a user, would expect the following: -> foo-0.9 from repository Y is being installed and maintained. If I change the priorities, the system, just at this moment, should not do anything. On the next upgrade cycle (zypper up -t package) it should evaluate it and make decisions. There I would expect it not to downgrade a package though, even if a repo with higher priority has a older version. I see it especially as important when I install a new RPM. Dominique -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Michael Andres wrote:
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).
(In reply to comment #4 from Lars Vogdt)
Wouldn't this make things more complicated if a user wants to "downrate" an existing repo instead of "uprating" all others?
sure
I would suggest to use a default value of 50 ... :-)
I like this idea, can't we make it so? Cheers, jano -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Jano Kupec wrote:
Michael Andres wrote:
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).
(In reply to comment #4 from Lars Vogdt)
Wouldn't this make things more complicated if a user wants to "downrate" an existing repo instead of "uprating" all others?
sure
I would suggest to use a default value of 50 ... :-)
I like this idea, can't we make it so?
(https://bugzilla.novell.com/show_bug.cgi?id=369827#c9 from Jan Engelhardt) If you default to 50, you only have 50 possible repositories below it if an unsigned integer is used. And if you use a signed integer, just default to 0 like smart — which is what most suse users that do not use yast/zypper use — does. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Sun, Mar 30, Jano Kupec wrote:
I would suggest to use a default value of 50 ... :-) I like this idea, can't we make it so?
(https://bugzilla.novell.com/show_bug.cgi?id=369827#c9 from Jan Engelhardt) If you default to 50, you only have 50 possible repositories below it if an unsigned integer is used. And if you use a signed integer, just default to 0
IMO 99 (least) is a safe default. You can always raise it, and if you really have to, you can as well use values below 99 [100,]. That's not yum conform, but our implementation will not hind you. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com 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: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Michael Andres wrote:
On Sun, Mar 30, Jano Kupec wrote:
I would suggest to use a default value of 50 ... :-) I like this idea, can't we make it so? (https://bugzilla.novell.com/show_bug.cgi?id=369827#c9 from Jan Engelhardt) If you default to 50, you only have 50 possible repositories below it if an unsigned integer is used. And if you use a signed integer, just default to 0
IMO 99 (least) is a safe default. You can always raise it, and if you really have to, you can as well use values below 99 [100,]. That's not yum conform, but our implementation will not hind you.
But then we should explicitly state that we support these values (zypper now says you must use 1-99). j. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Jan Kupec wrote:
But then we should explicitly state that we support these values (zypper now says you must use 1-99).
j.
No, we document the spec, not the implementation. Actually the spec right now has a conflict between yum and smart: YUM: With the plugin enabled, you can add priorities to repositories by adding the line: priority=N to a repository entry, where /N/ is an integer number from 1 to 99. The default priority for repositories is 99. The repositories with the lowest priority number have the highest priority. Usually, it is best to give at least the CentOS /base/ and /update/ repositories a very high priority. In the following example of the *CentOS-Base.repo* file, the CentOS /base/ and /update/ repositories are given the highest possible priority (1): Smart: Usage: smart priority [options] This command allows changing the priority of given packages. Packages with higher priorities are considered a better option even when package versions state otherwise. Using priorities one may avoid unwanted upgrades, force downgrades, select packages in given channels as preferential, and other kinds of interesting setups. When a package has no explicit priority, the channel priority is used. The channel priority may be changed using the 'channel' command, and defaults to 0 when not set. Notice that negatives priorities must be preceded by '--' in the command line, otherwise they'll be interpreted as command line options. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Duncan Mac-Vicar P. wrote:
Jan Kupec wrote:
But then we should explicitly state that we support these values (zypper now says you must use 1-99).
j.
No, we document the spec, not the implementation.
i'm not talking about documenting the implementation. I'm talking about documenting the supported values in man zypper, zypper help mr, and in mr command messages.
Actually the spec right now has a conflict between yum and smart:
specs? you mean the man pages? do they serve as specifications? spec of what? yum/smart functionality? then a conflict is not a real issue. Spec of some kind of standard? Then it would be an issue. j.
YUM:
With the plugin enabled, you can add priorities to repositories by adding the line:
priority=N
to a repository entry, where /N/ is an integer number from 1 to 99. The default priority for repositories is 99. The repositories with the lowest priority number have the highest priority. Usually, it is best to give at least the CentOS /base/ and /update/ repositories a very high priority. In the following example of the *CentOS-Base.repo* file, the CentOS /base/ and /update/ repositories are given the highest possible priority (1):
Smart:
Usage: smart priority [options]
This command allows changing the priority of given packages. Packages with higher priorities are considered a better option even when package versions state otherwise. Using priorities one may avoid unwanted upgrades, force downgrades, select packages in given channels as preferential, and other kinds of interesting setups. When a package has no explicit priority, the channel priority is used. The channel priority may be changed using the 'channel' command, and defaults to 0 when not set.
Notice that negatives priorities must be preceded by '--' in the command line, otherwise they'll be interpreted as command line options.
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Mon, Mar 31, Jan Kupec wrote:
Duncan Mac-Vicar P. wrote:
Jan Kupec wrote:
But then we should explicitly state that we support these values (zypper now says you must use 1-99).
j.
No, we document the spec, not the implementation.
i'm not talking about documenting the implementation. I'm talking about documenting the supported values in man zypper, zypper help mr, and in mr command messages.
It's IMO sufficient if we state, that values outside [1-99] are not to be used with YUM. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com 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: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (8)
-
Dominique Leuenberger
-
Duncan Mac-Vicar P.
-
Duncan Mac-Vicar Prett
-
Jan Kupec
-
Jano Kupec
-
Klaus Kaempf
-
Ladislav Slezak
-
Michael Andres