Skip to content

Commit 7259a99

Browse files
author
Thom May
committed
CHEF-988: Make yum only do updates if it don't got a version
1 parent bc44127 commit 7259a99

File tree

1 file changed

+4
-3
lines changed
  • chef/lib/chef/provider/package

1 file changed

+4
-3
lines changed

‎chef/lib/chef/provider/package/yum.rb‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,11 @@ def install_package(name, version)
140140
end
141141

142142
defupgrade_package(name,version)
143-
# If we have a version, we can upgrade - otherwise, install
144-
if@current_resource.version
143+
# If we're not given a version, running update is the correct
144+
# option. If we are, then running install_package is right.
145+
unlessversion
145146
run_command_with_systems_locale(
146-
:command=>"yum -d0 -e0 -y update #{name}-#{version}"
147+
:command=>"yum -d0 -e0 -y update #{name}"
147148
)
148149
@yum.flush
149150
else

0 commit comments

Comments
(0)