Issue #12678 has been updated by Todd Zullinger.

I did a little more with this, and it seems to work easier than I expected 
(which means there are major things I'm overlooking, obviously).  I put the 
changes at 
https://github.com/tmzullinger/puppet/tree/tickets/master/12678-yum-respect-provides
 if anyone wants to give this a more thorough poking.  I didn't run the tests 
to see if it breaks anything.  I did try using package provides and paths with 
ensure => installed and ensure => latest.

One drawback with checking paths is that we cause the filelists for all repos 
to be pulled down if a file is outside of /etc/ or /usr (I believe those are 
the paths yum keeps in the primary db, but I could very well be wrong on that). 
 Whether this is a problem in practice is something I'm not sure about yet.  
Just something to keep in mind as we consider this.

The changes are made against master, but should be easily applied to older 
branches.  The yumhelper.py script is not touched that often.  As part of this 
work, I removed the old code to make it compatible with EL-3 (!).  That's been 
unsupported for ages now, so carrying around cruft on its account seems crazy.  
Those commits are likely something to push separately, at some point.
----------------------------------------
Bug #12678: yum provider doesn't respect items provided by a package, only the 
package name
https://projects.puppetlabs.com/issues/12678#change-55031

Author: Michael Stahnke
Status: Accepted
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 2.7.10
Keywords: yum package provides whatprovides
Branch: 


A simple use case:

In EL5 and earlier, the curl development headers were included in a package 
called curl-devel.  In EL6 and later that package was renamed to libcurl-devel. 
 However, the libcurl-devel package still provides curl-devel.  

When using something like 

    package { "curl-devel":
      ensure => installed
    }

puppet looks for this package every time. 

    [root@centos6-32 ~]# puppet resource package libcurl-devel
    warning: Package kernel found in both yum and yum; skipping the yum version
    warning: Package gpg-pubkey found in both yum and yum; skipping the yum 
version
    package { 'libcurl-devel':
      ensure => '7.19.7-26.el6_1.2',
    }
    [root@centos6-32 ~]# puppet resource package curl-devel
    warning: Package kernel found in both yum and yum; skipping the yum version
    warning: Package gpg-pubkey found in both yum and yum; skipping the yum 
version
    package { 'curl-devel':
        ensure => 'absent',
    }
    [root@centos6-32 ~]# rpm -q --whatprovides curl-devel
    libcurl-devel-7.19.7-26.el6_1.2.i686
    [root@centos6-32 ~]# 

The yum provider should basically use the way yum work to make this happen.  If 
I do "yum install curl-devel" on EL6, it pulls in libcurl-devel.  If I then do 
an rpm -q --whatprovides curl-devel it shows that libcurl-devel provides that, 
and thus something does not need to be installed.  

Fixing this would likely have the side-benefit of being able to use the file 
installation methods on yum as well.  Such as
    yum install /usr/bin/foo

Puppet would be like
  package { "/usr/bin/foo": 
     ensure => installed,
  }

That would then install whatever package contains the file /usr/bin/foo, as yum 
from the CLI does.  




-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to