(distro_id)
return found
Check if Blockstream Satellite's binary package repository is enabled

    Args:
        distro_id: Linux distribution ID

    Returns:
        (bool) True if the repository is already enabled
Check if Blockstream Satellite's binary package repository is enabled
Check if Blockstream Satellite s binary package repository is enabled
def _check_pkg_repo(distro_id):
    """Check if Blockstream Satellite's binary package repository is enabled

    Args:
        distro_id: Linux distribution ID

    Returns:
        (bool) True if the repository is already enabled

    """
    found = False
    if (which("apt")):
        apt_repo = _get_apt_repo(distro_id)
        grep_str = apt_repo.replace("ppa:", "")
        apt_sources = glob.glob("/etc/apt/sources.list.d/*")
        apt_sources.append("/etc/apt/sources.list")
        cmd = ["grep", grep_str]
        cmd.extend(apt_sources)
        res = runner.run(cmd, stdout=subprocess.DEVNULL, nocheck=True)
        found = (res.returncode == 0)
    elif (which("dnf")):
        res = runner.run(["dnf", "copr", "list", "--enabled"],
                         root=True,
                         capture_output=True)
        pkgs = res.stdout.decode().splitlines()
        found = ("copr.fedorainfracloud.org/blockstream/satellite" in pkgs)
    elif (which("yum")):
        yum_sources = glob.glob("/etc/yum.repos.d/*")
        cmd = ["grep", "blockstream/satellite"]
        cmd.extend(yum_sources)
        res = runner.run(cmd, stdout=subprocess.DEVNULL, nocheck=True)
        found = (res.returncode == 0)
    else:
        raise RuntimeError("Could not find a supported package manager")

    if (found):
        logger.debug("blockstream/satellite repository already enabled")

    return found
def _check_pkg_repo ( distro_id ) : found = False if ( which ( "apt" ) ) : apt_repo = _get_apt_repo ( distro_id ) grep_str = apt_repo . replace ( "ppa:" , "" ) apt_sources = glob . glob ( "/etc/apt/sources.list.d/*" ) apt_sources . append ( "/etc/apt/sources.list" ) cmd = [ "grep" , grep_str ] cmd . extend ( apt_sources ) res = runner . run ( cmd , stdout = subprocess . DEVNULL , nocheck = True ) found = ( res . returncode == 0 ) elif ( which ( "dnf" ) ) : res = runner . run ( [ "dnf" , "copr" , "list" , "--enabled" ] , root = True , capture_output = True ) pkgs = res . stdout . decode ( ) . splitlines ( ) found = ( "copr.fedorainfracloud.org/blockstream/satellite" in pkgs ) elif ( which ( "yum" ) ) : yum_sources = glob . glob ( "/etc/yum.repos.d/*" ) cmd = [ "grep" , "blockstream/satellite" ] cmd . extend ( yum_sources ) res = runner . run ( cmd , stdout = subprocess . DEVNULL , nocheck = True ) found = ( res . returncode == 0 ) else : raise RuntimeError ( "Could not find a supported package manager" ) if ( found ) : logger . debug ( "blockstream/satellite repository already enabled" ) return found