lib/chef/provider/package.rb in chef-0.10.10.beta.1 vs lib/chef/provider/package.rb in chef-0.10.10.rc.1

- old
+ new

@@ -34,11 +34,11 @@ @candidate_version = nil end def action_install # If we specified a version, and it's not the current version, move to the specified version - if @new_resource.version != nil && @new_resource.version != @current_resource.version + if @new_resource.version != nil && !target_version_already_installed? install_version = @new_resource.version # If it's not installed at all, install it elsif @current_resource.version == nil install_version = candidate_version else @@ -195,9 +195,15 @@ remote_file end def expand_options(options) options ? " #{options}" : "" + end + + private + + def target_version_already_installed? + @new_resource.version == @current_resource.version end end end end