def write_bashrc(_path):
    """
    Write a valid gentoo bashrc file to :path:.

    Args:
        path - The output path of the make.conf
    """
    cfg_mounts = CFG["container"]["mounts"].value
    cfg_prefix = CFG["container"]["prefixes"].value

    path.mkfile_uchroot("/etc/portage/bashrc")
    mounts = uchroot.mounts("mnt", cfg_mounts)
    p_paths, p_libs = uchroot.env(cfg_prefix)
    paths, libs = uchroot.env(mounts)

    paths = paths + p_paths
    libs = libs + p_libs

    with open(_path, 'w') as bashrc:
        lines = '''
export PATH="{0}:${{PATH}}"
export LD_LIBRARY_PATH="{1}:${{LD_LIBRARY_PATH}}"
'''.format(path.list_to_path(paths), path.list_to_path(libs))

        bashrc.write(lines)
Write a valid gentoo bashrc file to :path:.

    Args:
        path - The output path of the make.conf