(interactive=True, update=False, btc=False)
Install dependencies that are common to all setups
Install dependencies that are common to all setups
Install dependencies that are common to all setups
def _install_common(interactive=True, update=False, btc=False):
    """Install dependencies that are common to all setups"""
    util.print_header("Installing Common Dependencies")
    apt_pkg_list = ["software-properties-common"]
    dnf_pkg_list = ["dnf-plugins-core"]
    yum_pkg_list = ["yum-plugin-copr"]

    # "gnupg" is installed as a dependency of "software-properties-common" on
    # Ubuntu. In contrast, it is not a dependency on Debian. Hence, add it
    # explicitly to the list. Add also "dirmngr", which may not be
    # automatically installed with gnupg (it is only automatically installed
    # from buster onwards). Lastly, add "apt-transport-https" to fetch debian
    # and raspbian packages from Aptly using HTTPS.
    distro_id = distro.id()
    if distro_id in ["debian", "raspbian"]:
        apt_pkg_list.extend(["gnupg", "dirmngr", "apt-transport-https"])

    if distro_id == "centos":
        dnf_pkg_list.append("epel-release")
        yum_pkg_list.append("epel-release")

    _install_packages(apt_pkg_list, dnf_pkg_list, yum_pkg_list, interactive,
                      update)

    # Enable our binary package repository
    if runner.dry or (not _check_pkg_repo(distro_id)):
        _enable_pkg_repo(distro_id, interactive)

    # Install bitcoin-satellite
    if (btc):
        apt_pkg_list = [
            "bitcoin-satellite", "bitcoin-satellite-qt", "bitcoin-satellite-tx"
        ]
        dnf_pkg_list = ["bitcoin-satellite", "bitcoin-satellite-qt"]
        yum_pkg_list = ["bitcoin-satellite", "bitcoin-satellite-qt"]

        if (which("dnf")):
            # dnf matches partial package names, and so it seems that when
            # bitcoin-satellite and bitcoin-satellite-qt are installed in one
            # go, only the latter gets installed. The former is matched to
            # bitcoin-satellite-qt and assumed as installed. Hence, as a
            # workaround, install the two packages separately.
            for pkg in dnf_pkg_list:
                _install_packages(apt_pkg_list, [pkg], [pkg], interactive,
                                  update)
        else:
            _install_packages(apt_pkg_list, [], yum_pkg_list, interactive,
                              update)
def _install_common ( interactive = True , update = False , btc = False ) : util . print_header ( "Installing Common Dependencies" ) apt_pkg_list = [ "software-properties-common" ] dnf_pkg_list = [ "dnf-plugins-core" ] yum_pkg_list = [ "yum-plugin-copr" ] # "gnupg" is installed as a dependency of "software-properties-common" on # Ubuntu. In contrast, it is not a dependency on Debian. Hence, add it # explicitly to the list. Add also "dirmngr", which may not be # automatically installed with gnupg (it is only automatically installed # from buster onwards). Lastly, add "apt-transport-https" to fetch debian # and raspbian packages from Aptly using HTTPS. distro_id = distro . id ( ) if distro_id in [ "debian" , "raspbian" ] : apt_pkg_list . extend ( [ "gnupg" , "dirmngr" , "apt-transport-https" ] ) if distro_id == "centos" : dnf_pkg_list . append ( "epel-release" ) yum_pkg_list . append ( "epel-release" ) _install_packages ( apt_pkg_list , dnf_pkg_list , yum_pkg_list , interactive , update ) # Enable our binary package repository if runner . dry or ( not _check_pkg_repo ( distro_id ) ) : _enable_pkg_repo ( distro_id , interactive ) # Install bitcoin-satellite if ( btc ) : apt_pkg_list = [ "bitcoin-satellite" , "bitcoin-satellite-qt" , "bitcoin-satellite-tx" ] dnf_pkg_list = [ "bitcoin-satellite" , "bitcoin-satellite-qt" ] yum_pkg_list = [ "bitcoin-satellite" , "bitcoin-satellite-qt" ] if ( which ( "dnf" ) ) : # dnf matches partial package names, and so it seems that when # bitcoin-satellite and bitcoin-satellite-qt are installed in one # go, only the latter gets installed. The former is matched to # bitcoin-satellite-qt and assumed as installed. Hence, as a # workaround, install the two packages separately. for pkg in dnf_pkg_list : _install_packages ( apt_pkg_list , [ pkg ] , [ pkg ] , interactive , update ) else : _install_packages ( apt_pkg_list , [ ] , yum_pkg_list , interactive , update )