Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Development (http://www.linux-archive.org/fedora-development/)
-   -   how to have yum prefer one dependency over others (http://www.linux-archive.org/fedora-development/576554-how-have-yum-prefer-one-dependency-over-others.html)

Matyas Selmeci 09-16-2011 04:33 PM

how to have yum prefer one dependency over others
 
Hi all,

Hope it's okay to ask for general RPM/Yum advice here.

We have several packages that require grid CA certificates to be
installed. There are multiple sets of grid certificates, and we want to
leave up to individual sites which set to install. We also want to give
the sites the option to install none of them if they know what they are
doing and want to manage certificates by themselves.

So what we do is we add to each package that requires grid certificates
a 'Requires: grid-certificates' line, and to each package that provides
grid certificates a 'Provides: grid-certificates' line. We also create a
dummy package, called 'no-ca-certs' that does nothing but provide the
grid-certificates dependency.

We want to set it up so that one of these certs packages is preferred
over the others, so that if the user doesn't explicitly choose which one
to install, then that package is installed by default. How can we do
that? We tried having the packages provide different versions of the
grid-certificates virtual dependency (i.e. no-ca-certs would have
'Provides: grid-certificates = 1', osg-ca-certs (which we prefer) would
have 'Provides: grid-certificates = 2') in hopes that yum would pick the
one with the highest version, but it didn't help. Any ideas?

Thanks,
-Matyas Selmeci

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

seth vidal 09-16-2011 04:36 PM

how to have yum prefer one dependency over others
 
On Fri, 2011-09-16 at 11:33 -0500, Matyas Selmeci wrote:
> Hi all,
>
> Hope it's okay to ask for general RPM/Yum advice here.
>
> We have several packages that require grid CA certificates to be
> installed. There are multiple sets of grid certificates, and we want to
> leave up to individual sites which set to install. We also want to give
> the sites the option to install none of them if they know what they are
> doing and want to manage certificates by themselves.
>
> So what we do is we add to each package that requires grid certificates
> a 'Requires: grid-certificates' line, and to each package that provides
> grid certificates a 'Provides: grid-certificates' line. We also create a
> dummy package, called 'no-ca-certs' that does nothing but provide the
> grid-certificates dependency.
>
> We want to set it up so that one of these certs packages is preferred
> over the others, so that if the user doesn't explicitly choose which one
> to install, then that package is installed by default. How can we do
> that? We tried having the packages provide different versions of the
> grid-certificates virtual dependency (i.e. no-ca-certs would have
> 'Provides: grid-certificates = 1', osg-ca-certs (which we prefer) would
> have 'Provides: grid-certificates = 2') in hopes that yum would pick the
> one with the highest version, but it didn't help. Any ideas?

Here is how yum does comparison between multiple package providing the
same thing:

http://yum.baseurl.org/wiki/CompareProviders

if you follow that as your guide you can probably make one of them be
the default choice.

-sv


--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Richard Hughes 09-16-2011 05:26 PM

how to have yum prefer one dependency over others
 
On 16 September 2011 17:36, seth vidal <skvidal@fedoraproject.org> wrote:
> Here is how yum does comparison between multiple package providing the
> same thing:
> http://yum.baseurl.org/wiki/CompareProviders

I don't think that works for all cases; surely "grid-certificates = 2"
wins over "grid-certificates = 1" in all cases? It's certainly better
than relying on the length of the package name or alphabetical
ordering...

In Zif, I'm doing something like:

* Filter by best arch
* Filter by depend version
* Filter by native arch
* Filter by smallest name
* Filter by newest

...and this seems to work well as normal people don't want to drag
non-native architecture packages onto their system for an update and
want to follow the latest provide version (even if that means
installing additional deps). The current logic where yum wants to
install a hundred i686 packages on my x86_64 box when the repos get a
bit screwy doesn't seem to work very well in my opinion.

Richard.
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Miloslav Trmač 09-16-2011 05:31 PM

how to have yum prefer one dependency over others
 
On Fri, Sep 16, 2011 at 7:26 PM, Richard Hughes <hughsient@gmail.com> wrote:
> On 16 September 2011 17:36, seth vidal <skvidal@fedoraproject.org> wrote:
>> Here is how yum does comparison between multiple package providing the
>> same thing:
>> http://yum.baseurl.org/wiki/CompareProviders
<snip>
> In Zif, I'm doing something like:
...

I don't particularly care how the best provider is selected, but
having different tools use different rules is not acceptable.
Mirek
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

seth vidal 09-16-2011 05:43 PM

how to have yum prefer one dependency over others
 
On Fri, 2011-09-16 at 19:31 +0200, Miloslav Trmač wrote:
> On Fri, Sep 16, 2011 at 7:26 PM, Richard Hughes <hughsient@gmail.com> wrote:
> > On 16 September 2011 17:36, seth vidal <skvidal@fedoraproject.org> wrote:
> >> Here is how yum does comparison between multiple package providing the
> >> same thing:
> >> http://yum.baseurl.org/wiki/CompareProviders
> <snip>
> > In Zif, I'm doing something like:
> ...
>
> I don't particularly care how the best provider is selected, but
> having different tools use different rules is not acceptable.

having different tools is not acceptable. Especially when one of them is
not even remotely covering the use cases of our actual users.

I think I'm going to suggest to fesco that all non-yum depsolvers be
removed from the distribution. It just creates more work than it does
value.

If someone wants to ship a depsolver in their own repo on fedorapeople,
that's fine but providing it in the distro is just a mistake.

-sv


--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

seth vidal 09-16-2011 05:49 PM

how to have yum prefer one dependency over others
 
On Fri, 2011-09-16 at 18:26 +0100, Richard Hughes wrote:
> On 16 September 2011 17:36, seth vidal <skvidal@fedoraproject.org> wrote:
> > Here is how yum does comparison between multiple package providing the
> > same thing:
> > http://yum.baseurl.org/wiki/CompareProviders
>
> I don't think that works for all cases; surely "grid-certificates = 2"
> wins over "grid-certificates = 1" in all cases? It's certainly better
> than relying on the length of the package name or alphabetical
> ordering...

Which, if you read, yum doesn't do exclusively.

Here's what yum does.
0. each pkg starts out with a score of 0.

1. if any of the providers is a newer version of something we have
installed then increase their score by 5

2. if any of the providers are not the newest version of themselves then
decrease their score by 1024.

3. if any of the providers are obsoleted by another provider, decrease
that provider by 1024.

4. check the arch distance between the requiring pkg and each of the
providers. The pkg with the smallest arch distance gets a 5 added to
their score. Do the same check but comparing the pkg arch distance to
the system arch, not the requiring pkg arch

5. compare the sourcerpm on each provider to the requiring pkg's source
rpm. If they share a sourcerpm add 20 to the score

6. check the base pkg for each subpkg. If the base pkg is installed on
the system add 5 to the provider's score.

7. check the prefix of the pkg to the requiring pkg prefix (perl-foo and
perl-lib) for each common character in the prefix add 2 points to the
provider's score.

8. if, at this point, we have pkgs with an equal score - look at the
deplist (one layer deep) and see what they would pull in that is NOT
already installed. Add 1 to the score of the pkg with the least new deps
to be pulled in.

9. if all else fails and we STILL have two pkgs with the same score -
take the leaders from the list and compare their name length. We add
1,000 and then subtract the length of the number of character's in the
pkgs name from its score (the addition of 1000 is to ensure that one of
the leaders will be picked).

10. return the list of providers, sorted best to worst.

11. if the packages are the same length, then the packages are compared
as shown in "yum list". The one lower in the list will win.

>
> In Zif, I'm doing something like:
>
> * Filter by best arch
> * Filter by depend version
> * Filter by native arch
> * Filter by smallest name
> * Filter by newest

So you fail to take shortest number of deps and you're going to
generally fail for a any number of pkgs which really need a
closely-related sibling package but something else outside of their srpm
also provides what they need.

That happens a lot in the kde/gnome world and with many of the languages
with a large number of modules. (python, perl, etc)

Yum's depsolving and provider comparison is significantly more mature
and works in actual uses not just theoretically.

That you've implemented a depsolver for use with PK that does not match
yum nor anaconda is pretty bad. You've chosen intentional
incompatibility. That's neither helpful nor really embodying the goals I
like to think of in fedora.


> non-native architecture packages onto their system for an update and
> want to follow the latest provide version (even if that means
> installing additional deps). The current logic where yum wants to
> install a hundred i686 packages on my x86_64 box when the repos get a
> bit screwy doesn't seem to work very well in my opinion.

There are still a largish number of packages out there that have things
like:

Requires: foo

where they really want:
Requires: foo(64bit)

Which causes the other path you're describing.

It's sad that you've chosen to implement something else entirely on your
own rather than working with the growing number of people working on
yum.

-sv


--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Richard Hughes 09-16-2011 06:42 PM

how to have yum prefer one dependency over others
 
On 16 September 2011 18:43, seth vidal <skvidal@fedoraproject.org> wrote:
> having different tools is not acceptable. Especially when one of them is
> not even remotely covering the use cases of our actual users.

Installing 205 new i686 packages when updating the system is not acceptable.

> I think I'm going to suggest to fesco that all non-yum depsolvers be
> removed from the distribution. It just creates more work than it does
> value.

Ha! That's really funny, and it's just made my evening. While you're
asking fesco, can you also ask them to remove KDE and XFCE as well
please.

There's really nothing special about a package manager I assure you.

Richard.
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Miloslav Trmač 09-16-2011 06:45 PM

how to have yum prefer one dependency over others
 
On Fri, Sep 16, 2011 at 8:42 PM, Richard Hughes <hughsient@gmail.com> wrote:
>> I think I'm going to suggest to fesco that all non-yum depsolvers be
>> removed from the distribution. It just creates more work than it does
>> value.
>
> Ha! That's really funny, and it's just made my evening. While you're
> asking fesco, can you also ask them to remove KDE and XFCE as well
> please.
>
> There's really nothing special about a package manager I assure you.

How about the 1126 members of the "packager" group - i.e. most of us -
that would have to create and maintain packages compatible with two
different systems?
Mirek
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Richard Hughes 09-16-2011 06:48 PM

how to have yum prefer one dependency over others
 
2011/9/16 Miloslav Trmač <mitr@volny.cz>:
> How about the 1126 members of the "packager" group - i.e. most of us -
> that would have to create and maintain packages compatible with two
> different systems?

That's nonsense, sorry. Zif is quite capable of using the same
metadata as yum and performing the same function with the same set of
packages.

Richard.
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

seth vidal 09-16-2011 06:50 PM

how to have yum prefer one dependency over others
 
On Fri, 2011-09-16 at 19:42 +0100, Richard Hughes wrote:
> On 16 September 2011 18:43, seth vidal <skvidal@fedoraproject.org> wrote:
> > having different tools is not acceptable. Especially when one of them is
> > not even remotely covering the use cases of our actual users.
>
> Installing 205 new i686 packages when updating the system is not acceptable.

I agree with that. The cases where that occurs are all tied up in
insufficiently specified requirements.


> > I think I'm going to suggest to fesco that all non-yum depsolvers be
> > removed from the distribution. It just creates more work than it does
> > value.
>
> Ha! That's really funny, and it's just made my evening. While you're
> asking fesco, can you also ask them to remove KDE and XFCE as well
> please.

I've made the proposal for non-yum-based package managers to be removed
from fedora.

Your attitude is quite unfortunate. I'd hope you'd want to work with
others to make fedora better but you don't. There's a packaging team you
should work with and for if you intend to continue working on package
managers.

-sv






--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel


All times are GMT. The time now is 01:19 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.