lib/core/core_setup_init.rb
# Internal setup function to complete the list of attributes
# and organize attributes by step as requested by attr dependencies
# It loops on a list of unanalyzed attributes to determine
# new objects/attributes
#
# The analyze is based on attributes having setup obj (and group of deps)
# required
#
# A new level is added:
# - when a new group of deps is found.
#   Then each attributes required decrease the level by 1.
# - when a group already exist, nothing is done
#
# In case of depends_on, the attribute level is set to 0
# and depends_on attributes level are decreased.
# each attributes parsed get a level 0 if requires a group is requires
# otherwise level is set to nil.
Internal setup function to complete the list of attributes
and organize attributes by step as requested by attr dependencies
It loops on a list of unanalyzed attributes to determine
new objects/attributes

The analyze is based on attributes having setup obj (and group of deps)
required

A new level is added:
when a new group of deps is found.
Then each attributes required decrease the level by 1.
when a group already exist, nothing is done

In case of depends_on, the attribute level is set to 0
and depends_on attributes level are decreased.
each attributes parsed get a level 0 if requires a group is requires
otherwise level is set to nil.
Internal setup function to complete the list of attributes and organize attributes by step as requested by attr dependencies It loops on a list of unanalyzed attributes to determine new objects / attributes The analyze is based on attributes having setup obj ( and group of deps ) required A new level is added : when a new group of deps is found . Then each attributes required decrease the level by 1 . when a group already exist nothing is done In case of depends_on the attribute level is set to 0 and depends_on attributes level are decreased . each attributes parsed get a level 0 if requires a group is requires otherwise level is set to nil .
def _setup_build_steps_from(dependencies)
      count = dependencies[:attributes].length
      attrs_done = {}
      level = 0
      loop do
        attrs = dependencies[:attributes].clone
        attrs.each_key do |attr_name|
          next if attrs_done.key?(attr_name)
          element = _setup_bs_objs(attrs_done, dependencies, attr_name)
          attrs_done[attr_name] = element
          dependencies.rh_set(element, :attributes, attr_name)
          if element.rh_exist?(:group, :level)
            level = [level, element[:group][:level]].min
          end
          list_attrs = (element[:attrs] + element.rh_get(:group, :attrs)).uniq
          next if list_attrs.length == 0
          Lorj.debug(2, "setup: '%s' attribute dependency found '%s'",
                     attr_name, list_attrs.join(', '))
        end
        break if dependencies[:attributes].length == count
        count = dependencies[:attributes].length
      end
      attrs = dependencies[:attributes]
      _setup_bs_levels(attrs, level)
    end
def _setup_build_steps_from ( dependencies ) count = dependencies [ :attributes ] . length attrs_done = { } level = 0 loop do attrs = dependencies [ :attributes ] . clone attrs . each_key do | attr_name | next if attrs_done . key? ( attr_name ) element = _setup_bs_objs ( attrs_done , dependencies , attr_name ) attrs_done [ attr_name ] = element dependencies . rh_set ( element , :attributes , attr_name ) if element . rh_exist? ( :group , :level ) level = [ level , element [ :group ] [ :level ] ] . min end list_attrs = ( element [ :attrs ] + element . rh_get ( :group , :attrs ) ) . uniq next if list_attrs . length == 0 Lorj . debug ( 2 , "setup: '%s' attribute dependency found '%s'" , attr_name , list_attrs . join ( ', ' ) ) end break if dependencies [ :attributes ] . length == count count = dependencies [ :attributes ] . length end attrs = dependencies [ :attributes ] _setup_bs_levels ( attrs , level ) end
Internal setup function to complete the list of attributes
and organize attributes by step as requested by attr dependencies
It loops on a list of unanalyzed attributes to determine
new objects/attributes
Internal setup function to complete the list of attributes and organize attributes by step as requested by attr dependencies It loops on a list of unanalyzed attributes to determine new objects / attributes
# Thanks to attributes/group deps, set levels
dependencies
<not_specific>