def _symlinked_shared_dir(pname, version, env, extra_dir=None):
    base_dir, install_dir = _symlinked_install_dir(pname, version, env, extra_dir)
    relative_install_dir = os.path.relpath(install_dir, os.path.dirname(base_dir))
    # Does not exist, change symlink to new directory
    if not env.safe_exists(install_dir):
        env.safe_sudo("mkdir -p %s" % install_dir)
        if env.safe_exists(base_dir):
            env.safe_sudo("rm -f %s" % base_dir)
        env.safe_sudo("ln -sf %s %s" % (relative_install_dir, base_dir))
        return install_dir
    items = env.safe_run_output("ls %s" % install_dir)
    # empty directory, change symlink and re-download
    if items.strip() == "":
        if env.safe_exists(base_dir):
            env.safe_sudo("rm -f %s" % base_dir)
        env.safe_sudo("ln -sf %s %s" % (relative_install_dir, base_dir))
        return install_dir
    # Create symlink if previously deleted
    if not env.safe_exists(base_dir):
        env.safe_sudo("ln -sf %s %s" % (relative_install_dir, base_dir))
    return None
Post setup.
dataset/ETHPy150Open chapmanb/cloudbiolinux/cloudbio/custom/shared.py/_symlinked_shared_dir--crossover with--dataset/ETHPy150Open byt3bl33d3r/pth-toolkit/lib/python2.7/site-packages/samba/provision/backend.py/ProvisionBackend.post_setup