[Yum-devel] requested 'protectbase', as used in yum 2.0

Sean Dilda agrajag at dragaera.net
Mon Mar 7 14:26:14 UTC 2005


seth vidal wrote:
>>the repo scoring implementation code-wise is not all that hard - you
>>just add an attribute to the repository object and you use that as your
>>first-order separation when you have two packages of the same name from
>>different repositories providing the same requirement.
>>
>>Of course this doesn't even get into how you deal with obsoletes. Can a
>>package from a score 0 repo obsolete a score 2? 
> 
> 
> one other odd point:
> 
> rpmdb: foo-1.1-1
> repo1(score 0) foo-1.1-10
> repo2(score 20) foo-1.1-2
> 
> command: yum update foo
> 
> now, by scoring you'd get:
> foo-1.1-2 updating over foo-1.1-1
>  b/c repo2's score is 20 and repo1's score is 0
> 
> so we complete that function and we end up with:
> rpmdb: foo-1.1-2
> repo1 (score 0) foo-1.1-10
> repo2 (score 20) foo-1.1-2 
> 
> but we have no way of knowing the repo score of the installed package,
> nor any way of decisively knowing what repo it came from. Won't we end
> up with foo-1.1-10 updating overtop of foo-1.1-2 in the rpmdb?

In theory you could get around this by having yum notice that what's in 
the rpmdb matches what's in repo2, then 'ignore' repo1 since it sees the 
match.  However, that's probably not easy to code.

> 
> It seems like if we're going to have an additional number determining
> dependency resolution then we should continue to have that information
> in the rpmdb.

I actually agree, but due to a different scenario.  Lets say you have 
this (assuming yum would prefer repos with a higher score):

rpmdb: foo-1.0-1
repo1 (score 0): foo-1.1-10
repo2 (score 20): *DOES NOT CONTAIN foo*

You run a yum update, and you get:

rpmdb: foo-1.1-10
repo1 (score 0): foo-1.1-10
repo2 (score 20): *DOES NOT CONTAIN foo*

Now, lets say someone adds foo to repo2 and you get:

rpmdb: foo-1.1-10
repo1 (score 0): foo-1.1-10
repo2 (score 20): foo-1.1-2

What should happen when you do a yum update?  Should you keep the 
current rpm, or go to the 'preferred' repo?  And if you say you should 
go to the 'preferred' repo, you'll have to have some way to know what 
repo the current copy came from.

There is the possibility of doing a heuristic where you see the 
installed 'foo' header matches the 'foo' header from repo1, so you 
assume that the installed copy came from repo1.  However, someone may 
have installed that rpm outside of yum and want to keep it.  Likewise, 
the maintainer for repo1 may have removed 'foo' from his repo altogether.




More information about the Yum-devel mailing list