diff --git a/lib/chef/provider/package.rb b/lib/chef/provider/package.rb index 9edf8d5f525..848279e6888 100644 --- a/lib/chef/provider/package.rb +++ b/lib/chef/provider/package.rb @@ -55,8 +55,11 @@ def define_resource_requirements a.whyrun("Assuming a repository that offers #{forced_packages_missing_candidates.join(", ")} would have been configured") end + # XXX: Does it make sense to pass in a source with :upgrade? Probably + # not, but as with the above comment, we don't yet enforce such a thing, + # so we'll just leave things as-is for now. requirements.assert(:upgrade, :install) do |a| - a.assertion { candidates_exist_for_all_uninstalled? } + a.assertion { candidates_exist_for_all_uninstalled? || new_resource.source } a.failure_message(Chef::Exceptions::Package, "No candidate version available for #{packages_missing_candidates.join(", ")}") a.whyrun("Assuming a repository that offers #{packages_missing_candidates.join(", ")} would have been configured") end