summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Walters <cw@opscode.com>2011-03-28 12:17:57 -0700
committerChris Walters <cw@opscode.com>2011-03-28 14:32:21 -0700
commit78ca2b882ec2895275b318ed642df5602c072cbe (patch)
treeaf65424dfc5f1a1992aa37fab6d159213db25aad
parent2a58bf0fbcbcd5b27113182ed4ea13d19d044e70 (diff)
downloadchef-78ca2b882ec2895275b318ed642df5602c072cbe.tar.gz
Extracting the cookbook name from dependency specification
-rw-r--r--chef/lib/chef/cookbook_version_selector.rb5
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