diff options
author | Chris Walters <cw@opscode.com> | 2011-03-28 12:17:57 -0700 |
---|---|---|
committer | Chris Walters <cw@opscode.com> | 2011-03-28 14:32:21 -0700 |
commit | 78ca2b882ec2895275b318ed642df5602c072cbe (patch) | |
tree | af65424dfc5f1a1992aa37fab6d159213db25aad | |
parent | 2a58bf0fbcbcd5b27113182ed4ea13d19d044e70 (diff) | |
download | chef-78ca2b882ec2895275b318ed642df5602c072cbe.tar.gz |
Extracting the cookbook name from dependency specification
-rw-r--r-- | chef/lib/chef/cookbook_version_selector.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chef/lib/chef/cookbook_version_selector.rb b/chef/lib/chef/cookbook_version_selector.rb index 216de3726b..cd00e08a92 100644 --- a/chef/lib/chef/cookbook_version_selector.rb +++ b/chef/lib/chef/cookbook_version_selector.rb @@ -52,8 +52,11 @@ class Chef # Version object from the String representation. pv = dep_graph.package(cb_name).add_version(Chef::Version.new(cb_version.version)) cb_version_deps.each_pair do |dep_name, constraint_str| + # if the dependency is specified as cookbook::recipe, + # extract the cookbook component + dep_cb_name = dep_name.split("::").first constraint = Chef::VersionConstraint.new(constraint_str) - pv.dependencies << DepSelector::Dependency.new(dep_graph.package(dep_name), constraint) + pv.dependencies << DepSelector::Dependency.new(dep_graph.package(dep_cb_name), constraint) end end end |