diff options
author | lutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-03-16 17:55:59 +0000 |
---|---|---|
committer | lutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-03-16 17:55:59 +0000 |
commit | 28602a605cee749534d987e77c69dcea1247f3f0 (patch) | |
tree | 52ca4e09f91f9a51fccc7952da89de7470470b6f | |
parent | 95b762b78a68e50a104273fd43b277bc9f2696fb (diff) | |
download | puppet-28602a605cee749534d987e77c69dcea1247f3f0.tar.gz puppet-28602a605cee749534d987e77c69dcea1247f3f0.tar.xz puppet-28602a605cee749534d987e77c69dcea1247f3f0.zip |
Simplified as yum install can be used for both install and update
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1039 980ebf18-57e1-0310-9a29-db15c13687c0
-rwxr-xr-x | lib/puppet/type/package/yum.rb | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/lib/puppet/type/package/yum.rb b/lib/puppet/type/package/yum.rb index 4b234edce..750591782 100755 --- a/lib/puppet/type/package/yum.rb +++ b/lib/puppet/type/package/yum.rb @@ -15,15 +15,7 @@ module Puppet # What's the latest package version available? def latest - cmd = nil - # We have to behave differently if the package is installed vs. - # not installed. - if @is == :absent - cmd = "yum list %s" % self[:name] - else - cmd = "yum list updates %s" % self[:name] - end - #cmd = "yum list %s" % self[:name] + cmd = "yum list available %s" % self[:name] self.info "Executing %s" % cmd.inspect output = %x{#{cmd} 2>&1} @@ -41,20 +33,8 @@ module Puppet end def update - # Yum can't update packages that aren't there; we have to install - # them first - if self.is(:ensure) == :absent - self.info "performing initial install" - return self.install - end - cmd = "yum -y update %s" % self[:name] - - self.info "Executing %s" % cmd.inspect - output = %x{#{cmd} 2>&1} - - unless $? == 0 - raise Puppet::PackageError.new(output) - end + # Install in yum can be used for update, too + self.install end def versionable? |