def pkg_name_to_path(pkgname):
    """todo: Docstring for pkg_name_to_path

    :param pkgname: arg description
    :type pkgname: type description
    :return:
    :rtype:
    """

    logger.debug("'%s'", pkgname)

    fp = os.path.join(settings.upkg_destdir, pkgname)
    if os.path.isdir(fp):
        logger.debug("found %s", fp)
        return fp

    # Try to find the repo dir if just needs an extension
    for d in repo_dirlist():
        logger.debug("trying %s", d)
        if d['base'].startswith(pkgname):
            # logger.debug("startwith")
            root, ext = os.path.splitext(d['base'])
            if pkgname == root:
                logger.debug("found %s", d)
                return d['path']
    # end for d in dlist

    logger.debug("found nothing")
    return ""