From 1f380f9f180f39581f2e124061af1ee927a23e0c Mon Sep 17 00:00:00 2001 From: Phil Dibowitz Date: Tue, 3 Mar 2015 13:46:04 -0800 Subject: Allow people to pass in a 'source' to package rules Fixes #3008 --- lib/chef/provider/package.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/chef/provider') diff --git a/lib/chef/provider/package.rb b/lib/chef/provider/package.rb index 9edf8d5f52..848279e688 100644 --- a/lib/chef/provider/package.rb +++ b/lib/chef/provider/package.rb @@ -55,8 +55,11 @@ class Chef 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 -- cgit v1.2.1