def _distro2repo(distro, repo_mappings):
    """Map distribution names to repo names according to config settings."""
    # Parse the mapping config
    mappings = [(i.split('=', 1) if '=' in i else (i, i)) for i in repo_mappings.split()]

    # Try to find a match
    result = distro
    for pattern, target in mappings:
        if fnmatch.fnmatchcase(distro.lower(), pattern.lower()):
            result = target
            break

    trace("Mapped distro '%(distro)s' to '%(repo)s'", distro=distro, repo=result)
    return result
dataset/ETHPy150Open jhermann/artifactory-debian/dput-webdav/webdav.py/_distro2repo/original