Architecture support in up2date provider (patch)

3 views
Skip to first unread message

DerekW

unread,
Feb 25, 2009, 6:44:23 AM2/25/09
to Puppet Developers
Just came across an issue where I had to install pam.i386 as well as
pam.x86_64 on a RHEL4 machine (via up2date). With the yum provider
you can simply

package { "pam.i386": }

Because the underlying command is understood by yum
yum -y install pam.i386

With up to date this fails
up2date-nox -i pam.i386

You need to
up2date --arch=i386 pam

There has been a lot of discussion in the past (including myself)
about this, none of which came to a satisfactory conclusion. Packages
are inherently tricky as you have "pam", "pam.i386" and "pam.x86_64"
which doesn't sit comfortably with Puppet's concept of unique
resources.

So what I propose is something much simpler, rather than solve that
problem simply permit the same kludge within up2date as within yum,
i.e. this:

% diff -u /usr/lib/site_ruby/1.8/puppet/provider/package/up2date.rb
up2date.rb
--- /usr/lib/site_ruby/1.8/puppet/provider/package/up2date.rb
2007-06-17 23:06:42.000000000 +0100
+++ up2date.rb 2009-02-25 10:20:19.117606000 +0000
@@ -9,7 +9,15 @@

# Install a package using 'up2date'.
def install
- up2date "-u", @resource[:name]
+ arr = Array.new
+ arr = @resource[:name].split('.')
+ arch = arr.pop
+ truncname = arr.join('.')
+ if defined?(truncname) and not truncname.empty?
+ up2date "--arch=#{arch}", "-u", truncname
+ else
+ up2date "-u", @resource[:name]
+ end

unless self.query
raise Puppet::ExecutionFailure.new(

Thoughts? I'm only worried about packages with dots in their names,
however I don't believe they exist.

Regards,
Derek

Todd Zullinger

unread,
Feb 25, 2009, 10:52:21 AM2/25/09
to puppe...@googlegroups.com
DerekW wrote:
> Thoughts? I'm only worried about packages with dots in their names,
> however I don't believe they exist.

FWIW, they do on Fedora and CentOS 5. Take a look at:

repoquery --all --qf '%{name}' | grep '\.'

--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cogito cogito ergo cogito sum --
I think that I think, therefore I think that I am.
-- Ambrose Bierce, "The Devil's Dictionary"

David Lutterkort

unread,
Feb 25, 2009, 12:48:41 PM2/25/09
to puppe...@googlegroups.com

It's been a very long time that I had to deal with up2date ... if it has
any options to set the query format (similar to rpm --qf), you could
make that safer by using a query format that clearly separates arch
from package NVR.

Barring that, you can also makes that safer by checking only for known
arch suffixes (e.g. i?86, x86_64, noarch) instead of taking everything
after the last '.'

David


Luke Kanies

unread,
Mar 1, 2009, 11:42:46 PM3/1/09
to puppe...@googlegroups.com
Seems reasonable; that's how we do the other package types, right?
--
It is absurd to divide people into good and bad. People are either
charming or tedious. -- Oscar Wilde
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com

DerekW

unread,
Mar 2, 2009, 11:33:39 AM3/2/09
to Puppet Developers
David L - I hear ya. But we're still got far too many RHEL 4
boxes :-)

I'll clean up as suggested first as I certainly don't want to break
the installation of these ugly-named packages ;-)

Cheers,
Derek

Oliver Hookins

unread,
Mar 2, 2009, 4:21:21 PM3/2/09
to puppe...@googlegroups.com
On Mon Mar 02, 2009 at 08:33:39 -0800, DerekW wrote:
>
>David L - I hear ya. But we're still got far too many RHEL 4
>boxes :-)
>
>I'll clean up as suggested first as I certainly don't want to break
>the installation of these ugly-named packages ;-)

There are at least openoffice.org packages with a dot in the filename, and
this is what caused me most grief when I was trying to write a parser which
could handle all of the outputs of different versions of yum for the yum
handler - it can't be done easily.

--
Regards,
Oliver Hookins
Anchor Systems

Reply all
Reply to author
Forward
0 new messages