def egg_link_path(dist):<EOL>
sites = []<EOL>if running_under_virtualenv():<EOL><INDENT>if virtualenv_no_global():<EOL><INDENT>sites.append(site_packages)<EOL><DEDENT>else:<EOL><INDENT>sites.append(site_packages)<EOL>if user_site:<EOL><INDENT>sites.append(user_site)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>if user_site:<EOL><INDENT>sites.append(user_site)<EOL><DEDENT>sites.append(site_packages)<EOL><DEDENT>for site in sites:<EOL><INDENT>egglink = os.path.join(site, dist.project_name) + '<STR_LIT>'<EOL>if os.path.isfile(egglink):<EOL><INDENT>return egglink<EOL><DEDENT><DEDENT>return None<EOL>
Return the path for the .egg-link file if it exists, otherwise, None.

There's 3 scenarios:
1) not in a virtualenv
   try to find in site.USER_SITE, then site_packages
2) in a no-global virtualenv
   try to find in site_packages
3) in a yes-global virtualenv
   try to find in site_packages, then site.USER_SITE
   (don't look in global location)

For #1 and #3, there could be odd cases, where there's an egg-link in 2
locations.

This method will just return the first one found.