#NEWLINE# def decompose( cfg , suite ) : #NEWLINE# #INDENT# 'Decompose suite into packages and groups of packages.  \n\n    For every group in the suite there is one added to the waf <cfg> context.  \n\n    Every package has an env of the same name added to <cfg> which\n    contains variables defined either through its "environment"\n    variable or through any variables with names beginning with\n    "buildenv_".\n\n    The waf env is given a "munged_env" element which holds the result\n    of any environment munging applied to the current process\n    environment (os.environ).\n    ' #NEWLINE# base_env = cfg . env #NEWLINE# ( gl , gd ) = ( [ ] , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# ( pl , pd ) = ( [ ] , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# for group in suite [ 'groups' ] : #NEWLINE# #INDENT# group_name = group [ 'group' ] #NEWLINE# gl . append ( group_name ) #NEWLINE# gd [ group_name ] = group #NEWLINE# for package in group [ 'packages' ] : #NEWLINE# #INDENT# package_name = package [ 'package' ] #NEWLINE# pl . append ( package_name ) #NEWLINE# pd [ package_name ] = package #NEWLINE# #UNINDENT# #UNINDENT# base_env . orch_group_list = gl #NEWLINE# base_env . orch_group_dict = gd #NEWLINE# base_env . orch_package_list = pl #NEWLINE# base_env . orch_package_dict = pd #NEWLINE# for ( pkg_name , pkg ) in pd . items ( ) : #NEWLINE# #INDENT# mlist = make_envmungers ( pkg , menv ) #NEWLINE# environ = ( cfg . env . env or dict ( ) ) #NEWLINE# menv = mungers . apply ( mlist , ** environ ) #NEWLINE# new_env = base_env . derive ( ) #NEWLINE# new_env . munged_env = menv #NEWLINE# cfg . setenv ( pkg_name , new_env ) #NEWLINE# #UNINDENT# return