lib/berkshelf/resolver/graph.rb in berkshelf-3.0.0.beta4 vs lib/berkshelf/resolver/graph.rb in berkshelf-3.0.0.beta5
- old
+ new
@@ -8,10 +8,15 @@
store.cookbooks.each do |cookbook|
artifacts(cookbook.cookbook_name, cookbook.version)
end
end
+ # Add dependencies of a locally cached cookbook to the graph
+ #
+ # @param [Berkshelf::CachedCookbook] cookbook
+ #
+ # @return [Hash]
def populate_local(cookbook)
name = cookbook.cookbook_name
version = cookbook.version
artifacts(name, version)
@@ -21,9 +26,11 @@
end
# @param [Array<Berkshelf::Source>, Berkshelf::Source] sources
def populate(sources)
universe(sources).each do |cookbook|
+ next if has_artifact?(cookbook.name, cookbook.version)
+
artifacts(cookbook.name, cookbook.version)
cookbook.dependencies.each do |dependency, constraint|
artifacts(cookbook.name, cookbook.version).depends(dependency, constraint)
end