diff options
author | lutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-22 02:31:07 +0000 |
---|---|---|
committer | lutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-22 02:31:07 +0000 |
commit | beef01cbae4f2c2d08752401043271dc5a867eb6 (patch) | |
tree | bd8b2fb78858f18c51c49a8cfd6f7a2c70a5ab08 | |
parent | 3ac5cd90f11ae8689fef4f804dfca40cd5ca92b2 (diff) | |
download | puppet-beef01cbae4f2c2d08752401043271dc5a867eb6.tar.gz puppet-beef01cbae4f2c2d08752401043271dc5a867eb6.tar.xz puppet-beef01cbae4f2c2d08752401043271dc5a867eb6.zip |
Properly figure out when updates are available. Previously, packages would neverbe updated because 'yum list foo' first prints the currently installed package. Now we use 'yum list updates foo'
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@927 980ebf18-57e1-0310-9a29-db15c13687c0
-rwxr-xr-x | lib/puppet/type/package/yum.rb | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/puppet/type/package/yum.rb b/lib/puppet/type/package/yum.rb index 1cb652704..bc1ef9bbe 100755 --- a/lib/puppet/type/package/yum.rb +++ b/lib/puppet/type/package/yum.rb @@ -1,10 +1,7 @@ module Puppet Puppet.type(:package).newpkgtype(:yum, :rpm) do - # A derivative of DPKG; this is how most people actually manage - # Debian boxes, and the only thing that differs is that it can - # install packages from remote sites. - # Install a package using 'apt-get'. + # Install a package using 'yum'. def install cmd = "yum -y install %s" % self[:name] @@ -18,7 +15,7 @@ module Puppet # What's the latest package version available? def latest - cmd = "yum list %s" % self[:name] + cmd = "yum list updates %s" % self[:name] self.info "Executing %s" % cmd.inspect output = %x{#{cmd} 2>&1} @@ -29,12 +26,9 @@ module Puppet if output =~ /#{self[:name]}\S+\s+(\S+)\s/ return $1 else - self.debug "No version" - if Puppet[:debug] - print output - end - - return nil + # Yum didn't find updates, pretend the current + # version is the latest + return self[:version] end end |