diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-03-15 16:39:35 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-03-15 16:39:35 +0000 |
| commit | 5dcf3036b9e88084176a597f85e75c4a9e491c58 (patch) | |
| tree | e767d22f299dbc2bd4d7e30a273febd4a1d1af2f /lib | |
| parent | 7e908a57c88fdb1b1f842941f1bf0d720ff51a90 (diff) | |
Using differents commands with yum depending on whether the package is currently installed or not.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1035 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
| -rwxr-xr-x | lib/puppet/type/package/yum.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/puppet/type/package/yum.rb b/lib/puppet/type/package/yum.rb index 653c3eb01..4b234edce 100755 --- a/lib/puppet/type/package/yum.rb +++ b/lib/puppet/type/package/yum.rb @@ -15,7 +15,15 @@ module Puppet # What's the latest package version available? def latest - cmd = "yum list %s" % self[:name] + 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] self.info "Executing %s" % cmd.inspect output = %x{#{cmd} 2>&1} @@ -54,3 +62,5 @@ module Puppet end end end + +# $Id$ |
