def make_envmungers(pkg, all_packages):
    autoenv = []
    deps = pkg.get('depends') or []
    if isinstance(deps, type("")): deps = deps.split()
    
    for dep in deps:
        _, step = dep.split(':')
        what = step.split('_')[0]
        if what in all_packages:
            #print 'autoenv: package: "%s"' % what
            autoenv.append('package:%s' % what)
        else: # FIXME: assume this is a group, then.
            #print 'autoenv: group: "%s"' % what
            autoenv.append('group:%s' % what)

    if pkg.get('environment'):
        en = pkg.get('environment')
        #print 'autoenv: environment: "%s"' % en
        autoenv.extend([x.strip() for x in en.split(',')])
        
    ret = list()
    for other_pkg in resolve_packages(all_packages, autoenv):
        ret += mungers.construct('export_', **other_pkg)

    ret += mungers.construct('buildenv_', **pkg)

    # Do NOT append export_ mungers for the current pkg.

    return ret
Make a environment munger that will apply the export_VARIABLE
dataset/ETHPy150Open hwaf/hwaf/py-hwaftools/orch/envmunge.py/make_envmungers