summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom.may@betfair.com>2010-02-26 16:59:32 +0000
committerThom May <thom.may@betfair.com>2010-02-26 17:00:42 +0000
commit7259a992e8ce45c476ae4455542690d43f103154 (patch)
treea1260a3bb820f2a087cfdcca435ecb6c00e975de
parentbc441274c9c15de7227bd1f24b7f90aade8f7de0 (diff)
downloadchef-7259a992e8ce45c476ae4455542690d43f103154.tar.gz
CHEF-988: Make yum only do updates if it don't got a version
-rw-r--r--chef/lib/chef/provider/package/yum.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/chef/lib/chef/provider/package/yum.rb b/chef/lib/chef/provider/package/yum.rb
index eb7ed422dd..df238204e5 100644
--- a/chef/lib/chef/provider/package/yum.rb
+++ b/chef/lib/chef/provider/package/yum.rb
@@ -140,10 +140,11 @@ class Chef
end
def upgrade_package(name, version)
- # If we have a version, we can upgrade - otherwise, install
- if @current_resource.version
+ # If we're not given a version, running update is the correct
+ # option. If we are, then running install_package is right.
+ unless version
run_command_with_systems_locale(
- :command => "yum -d0 -e0 -y update #{name}-#{version}"
+ :command => "yum -d0 -e0 -y update #{name}"
)
@yum.flush
else