'Finds the true URL name of a package, when the given name isn\'t quite correct.
This is usually used to implement case-insensitivity.'

def _find_url_name(self, index_url, url_name, req):

    if (not index_url.url.endswith('/')):
        index_url.url += '/'
    page = self._get_page(index_url, req)
    if (page is None):
        logger.fatal(('Cannot    fetch    index    base    URL    %s' % index_url))
        return
    norm_name = normalize_name(req.url_name)
    for link in page.links:
        base = posixpath.basename(link.path.rstrip('/'))
        if (norm_name == normalize_name(base)):
            logger.notify(('Real    name    of    requirement    %s    is    %s' % (url_name, base)))
            return base
    return None
