diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-12-10 00:45:50 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-12-10 00:45:50 +0000 |
commit | 2d43580c50b6bb23ce1c938af276c69af750beb9 (patch) | |
tree | 1f2fd41136c590a3c9ebc4eb25ebf7a5483219ae /lib/puppet/type/component.rb | |
parent | d3b76d6e0d8891c8109d559f61363cd11c246529 (diff) | |
download | puppet-2d43580c50b6bb23ce1c938af276c69af750beb9.tar.gz puppet-2d43580c50b6bb23ce1c938af276c69af750beb9.tar.xz puppet-2d43580c50b6bb23ce1c938af276c69af750beb9.zip |
Most of the graph handling is now done, and all of the recursive types (basically just file, tidy, and component) now correctly use the generation mechanisms in the transactions, instead of sticking them in their @children array. Now I just need to go through the rest of the tests and make sure everything passes.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1901 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/type/component.rb')
-rw-r--r-- | lib/puppet/type/component.rb | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/lib/puppet/type/component.rb b/lib/puppet/type/component.rb index cadd586c8..f203179a8 100644 --- a/lib/puppet/type/component.rb +++ b/lib/puppet/type/component.rb @@ -23,42 +23,6 @@ module Puppet defaultto "component" end - # topo sort functions - def self.sort(objects) - list = [] - tmplist = {} - - objects.each { |obj| - self.recurse(obj, tmplist, list) - } - - return list.flatten - end - - # FIXME this method assumes that dependencies themselves - # are never components - def self.recurse(obj, inlist, list) - if inlist.include?(obj.object_id) - return - end - inlist[obj.object_id] = true - begin - obj.eachdependency { |req| - self.recurse(req, inlist, list) - } - rescue Puppet::Error => detail - raise Puppet::Error, "%s: %s" % [obj.path, detail] - end - - if obj.is_a? self - obj.each { |child| - self.recurse(child, inlist, list) - } - else - list << obj - end - end - # Remove a child from the component. def delete(child) if @children.include?(child) @@ -116,12 +80,6 @@ module Puppet return false end end - - # Return a flattened array containing all of the children - # and all child components' children, sorted in order of dependencies. - def flatten - self.class.sort(@children).flatten - end # Initialize a new component def initialize(args) |