The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Bug #5831

RPM provider should use --whatprovides to work with virtual packages

Added by Anonymous over 5 years ago. Updated almost 3 years ago.

Status:Code InsufficientStart date:01/10/2011
Priority:LowDue date:
Assignee:-% Done:

0%

Category:package
Target version:-
Affected Puppet version:development Branch:
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com


Description

RPM provides are ignored used in installation, but ignored in verification currently. The RPM provider calls “yum -y install blah” then “rpm -q blah”, but if the package “blah-sweet-new-package” provides the package “blah,” yum will install that if it has a higher version number. Howver, puppet will never think the “yum -y install blah” worked because “rpm -q blah” will never show anything, but “rpm -q —whatprovides blah” will list “blah-sweet-new-package.”

#rpm -q couchdb-lounge
package couchdb-lounge is not installed
#rpm -q couchdb-lounge2
package couchdb-lounge2 is not installed
#rpm -q --whatprovides couchdb-lounge
package couchdb-lounge is not installed
#rpm -q --whatprovides couchdb-lounge2
package couchdb-lounge2 is not installed
#puppetd -tvd
--snip--
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q couchdb-lounge --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}
'
debug: //role_lounge/Package[couchdb-lounge]: Changing ensure
debug: //role_lounge/Package[couchdb-lounge]: 1 change(s)
debug: Package[couchdb-lounge](provider=yum): Ensuring => latest
debug: Puppet::Type::Package::ProviderYum: Executing '/usr/bin/yum -d 0 -e 0 -y install couchdb-lounge'
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q couchdb-lounge --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}
'
err: //role_lounge/Package[couchdb-lounge]/ensure: change from absent to latest failed: Could not update: Could not find package couchdb-lounge at /home/adam/puppet-config/trunk/modules/role_lounge/manifests/init.pp:169
--end snip--
#rpm -q couchdb-lounge
package couchdb-lounge is not installed
#rpm -q couchdb-lounge2
couchdb-lounge2-2.1-3el5
#rpm -q --whatprovides couchdb-lounge
couchdb-lounge2-2.1-3el5
#rpm -q --whatprovides couchdb-lounge2
couchdb-lounge2-2.1-3el5
Now I try again after making the attached patch:
# yum remove \*lounge\*
#rpm -q couchdb-lounge couchdb-lounge2
package couchdb-lounge is not installed
package couchdb-lounge2 is not installed
#rpm -q --whatprovides couchdb-lounge couchdb-lounge2
no package provides couchdb-lounge
no package provides couchdb-lounge2
#puppetd -tvd
--snip--
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q couchdb-lounge --whatprovides --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}
'
debug: //role_lounge/Package[couchdb-lounge]: Changing ensure
debug: //role_lounge/Package[couchdb-lounge]: 1 change(s)
debug: Package[couchdb-lounge](provider=yum): Ensuring => latest
debug: Puppet::Type::Package::ProviderYum: Executing '/usr/bin/yum -d 0 -e 0 -y install couchdb-lounge'
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q couchdb-lounge --whatprovides --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}
'
notice: //role_lounge/Package[couchdb-lounge]/ensure: created
--end snip--
#rpm -q couchdb-lounge couchdb-lounge2
package couchdb-lounge is not installed
couchdb-lounge2-2.1-3el5
#rpm -q --whatprovides couchdb-lounge couchdb-lounge2
couchdb-lounge2-2.1-3el5
couchdb-lounge2-2.1-3el5

puppet master is Ubuntu 10.04.1 LTS and has puppet, puppet-common, and puppetmaster version 0.25.4-2ubuntu6, ruby1.8-1.8.7.249-2 installed

puppet client is CentOS 5.5 and has puppet-0.24.8-4.el5 and ruby-1.8.5-5.el5_4.8

rpmprovides.diff Magnifier (994 Bytes) Anonymous, 01/10/2011 10:31 pm

History

#1 Updated by Ben Hughes about 5 years ago

  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Nigel Kersten

#2 Updated by Anonymous almost 5 years ago

  • Status changed from Needs Decision to Code Insufficient
  • Priority changed from Normal to Low

Oh, the patch is insufficient. —whatprovides doesn’t understand adding a “.x86_64” or such to the package name:

$ rpm -q python-lounge
package python-lounge is not installed
$ rpm -q --whatprovides python-lounge
python-lounge2-2.1.5-1
$ rpm -q ImageMagick
ImageMagick-6.2.8.0-4.el5_5.3
$ rpm -q --whatprovides ImageMagick.x86_64
no package provides ImageMagick.x86_64

Maybe we could point out in the documentation of the yum package provider is subject to limitations when using with “Provides:”. I guess just point out that using the name from “Provides:”, though supported in yum, is not supported by the yum package provider, because it later calls rpm -q with that same name.

#3 Updated by Nigel Kersten almost 5 years ago

  • Assignee deleted (Nigel Kersten)

#4 Updated by Derek Higgins almost 3 years ago

We also hit this problem twice recently in the packstack project

https://bugzilla.redhat.com/show_bug.cgi?id=981116 https://bugzilla.redhat.com/show_bug.cgi?id=971801

It would be great to see a fix for this.

#5 Updated by Matthew Miller almost 3 years ago

The package architecture issue is a little tricky, since the architecture isn’t part of the provides information, yet yum will install by either provides or packagename. I think the best solution is probably to check for both — if the package isn’t found with rpm -q, try with rpm -q —whatprovides and count success if either works.

(The common case is that the package will be found, of course.)

PS: I think it is still the case that adding —nodigest —nosignature will make rpm -q slightly faster.

Also available in: Atom PDF