示例#1
0
def _install_brew_baseline(env, brew_cmd, ipkgs, packages):
    """Install baseline brew components not handled by dependency system.

    - Installation of required Perl libraries.
    - Ensures installed samtools does not overlap with bcftools
    - Upgrades any package dependencies
    """
    for dep in ["expat", "cmake", "pkg-config"]:
        _install_pkg(env, dep, brew_cmd, ipkgs)
    for dep in ["sambamba"]:  # Avoid conflict with homebrew-science sambamba
        env.safe_run("{brew_cmd} remove --force {dep}".format(**locals()))
    # if installing samtools, avoid bcftools conflicts
    if len([x for x in packages if x.find("samtools") >= 0]):
        with settings(warn_only=True):

            def _has_prog(prog):
                try:
                    return int(
                        env.safe_run_output(
                            "{brew_cmd} list samtools | grep -c {prog} | cat".
                            format(brew_cmd=brew_cmd, prog=prog)))
                except ValueError:
                    return 0

            if any(_has_prog(p) for p in ["bctools", "vcfutils.pl"]):
                env.safe_run("{brew_cmd} uninstall {pkg}".format(
                    brew_cmd=brew_cmd, pkg="samtools"))
                ipkgs["current"].pop("samtools", None)
        _install_pkg_latest(env, "samtools", ["--without-curses"], brew_cmd,
                            ipkgs)
    for dependency in ["htslib"]:
        if dependency in packages:
            if (dependency in ipkgs["outdated"]
                    or "chapmanb/cbl/%s" % dependency in ipkgs["outdated"]
                    or dependency not in ipkgs["current"]):
                _install_pkg_latest(env, dependency, [], brew_cmd, ipkgs)
    if "cpanminus" in packages:
        _install_pkg_latest(env, "cpanminus", [], brew_cmd, ipkgs)
        _install_pkg_latest(env, "samtools-library-0.1", [], brew_cmd, ipkgs)
        cpan.install_packages(env)
    # Ensure paths we may have missed on install are accessible to regular user
    if env.use_sudo:
        paths = ["share", "share/java"]
        for path in paths:
            with quiet():
                test_access = env.safe_run(
                    "test -d %s/%s && test -O %s/%s" %
                    (env.system_install, path, env.system_install, path))
            if test_access.failed and env.safe_exists(
                    "%s/%s" % (env.system_install, path)):
                env.safe_sudo("chown %s %s/%s" %
                              (env.user, env.system_install, path))
示例#2
0
def _install_brew_baseline(env, brew_cmd, ipkgs, packages):
    """Install baseline brew components not handled by dependency system.

    - Installation of required Perl libraries.
    - Ensures installed samtools does not overlap with bcftools
    - Upgrades any package dependencies
    """
    for dep in ["openssl"]:
        _safe_link_pkg(env, dep, brew_cmd)
    for dep in ["expat", "pkg-config", "xz"]:
        _install_pkg(env, dep, brew_cmd, ipkgs)
    # check if we have an older git and need to install it from brew
    git_version = None
    with quiet():
        with settings(warn_only=True):
            git_version = env.safe_run_output("git --version").strip().split()[-1]
    if git_version and LooseVersion(git_version) < LooseVersion("1.7"):
        _install_pkg(env, "git", brew_cmd, ipkgs)
    for dep in ["sambamba"]:  # Avoid conflict with homebrew-science sambamba
        env.safe_run("{brew_cmd} remove --force {dep}".format(**locals()))
    # if installing samtools, avoid bcftools conflicts
    if len([x for x in packages if x.find("samtools") >= 0]):
        with settings(warn_only=True):
            def _has_prog(prog):
                try:
                    return int(env.safe_run_output("{brew_cmd} list samtools | grep -c {prog} | cat".format(
                        brew_cmd=brew_cmd, prog=prog)))
                except ValueError:
                    return 0
            if any(_has_prog(p) for p in ["bctools", "vcfutils.pl"]):
                env.safe_run("{brew_cmd} uninstall {pkg}".format(brew_cmd=brew_cmd, pkg="samtools"))
                ipkgs["current"].pop("samtools", None)
        _install_pkg_latest(env, "samtools", ["--without-curses"], brew_cmd, ipkgs)
    for dependency in ["htslib"]:
        if dependency in packages:
            if (dependency in ipkgs["outdated"] or "chapmanb/cbl/%s" % dependency in ipkgs["outdated"]
                  or dependency not in ipkgs["current"]):
                _install_pkg_latest(env, dependency, [], brew_cmd, ipkgs)
    if "cpanminus" in packages:
        _install_pkg_latest(env, "cpanminus", [], brew_cmd, ipkgs)
        _install_pkg_latest(env, "samtools-library-0.1", [], brew_cmd, ipkgs)
        cpan.install_packages(env)
    # Ensure paths we may have missed on install are accessible to regular user
    if env.use_sudo:
        paths = ["share", "share/java"]
        for path in paths:
            with quiet():
                test_access = env.safe_run("test -d %s/%s && test -O %s/%s" % (env.system_install, path,
                                                                               env.system_install, path))
            if test_access.failed and env.safe_exists("%s/%s" % (env.system_install, path)):
                env.safe_sudo("chown %s %s/%s" % (env.user, env.system_install, path))
示例#3
0
def _install_brew_baseline(env, brew_cmd, ipkgs, packages):
    """Install baseline brew components not handled by dependency system.

    - Installation of required Perl libraries.
    - Upgrades any package dependencies
    """
    for dep in ["openssl"]:
        _safe_link_pkg(env, dep, brew_cmd)
    for dep in ["expat", "pkg-config", "xz", "unzip"]:
        _install_pkg(env, dep, brew_cmd, ipkgs)
    # check if we have an older git and need to install it from brew
    git_version = None
    with quiet():
        with settings(warn_only=True):
            git_version = env.safe_run_output(
                "git --version").strip().split()[-1]
    if git_version and LooseVersion(git_version) < LooseVersion("1.7"):
        _install_pkg(env, "git", brew_cmd, ipkgs)
    for dep in ["sambamba"]:  # Avoid conflict with homebrew-science sambamba
        env.safe_run("{brew_cmd} remove --force {dep}".format(**locals()))
    for dependency in ["htslib"]:
        if dependency in packages:
            if (dependency in ipkgs["outdated"]
                    or "chapmanb/cbl/%s" % dependency in ipkgs["outdated"]
                    or dependency not in ipkgs["current"]):
                _install_pkg_latest(env, dependency, [], brew_cmd, ipkgs)
    if "cpanminus" in packages:
        _install_pkg_latest(env, "cpanminus", [], brew_cmd, ipkgs)
        _install_pkg_latest(env, "samtools-library-0.1", [], brew_cmd, ipkgs)
        cpan.install_packages(env)
    # Ensure paths we may have missed on install are accessible to regular user
    if env.use_sudo:
        paths = ["share", "share/java"]
        for path in paths:
            with quiet():
                test_access = env.safe_run(
                    "test -d %s/%s && test -O %s/%s" %
                    (env.system_install, path, env.system_install, path))
            if test_access.failed and env.safe_exists(
                    "%s/%s" % (env.system_install, path)):
                env.safe_sudo("chown %s %s/%s" %
                              (env.user, env.system_install, path))
示例#4
0
def _install_brew_baseline(env, brew_cmd, ipkgs, packages):
    """Install baseline brew components not handled by dependency system.

    - Installation of required Perl libraries.
    - Upgrades any package dependencies
    """
    for dep in ["openssl"]:
        _safe_link_pkg(env, dep, brew_cmd)
    for dep in ["expat", "pkg-config", "xz", "unzip"]:
        _install_pkg(env, dep, brew_cmd, ipkgs)
    # check if we have an older git and need to install it from brew
    git_version = None
    with quiet():
        with settings(warn_only=True):
            git_version = env.safe_run_output("git --version").strip().split()[-1]
    if git_version and LooseVersion(git_version) < LooseVersion("1.7"):
        _install_pkg(env, "git", brew_cmd, ipkgs)
    for dep in ["sambamba"]:  # Avoid conflict with homebrew-science sambamba
        env.safe_run("{brew_cmd} remove --force {dep}".format(**locals()))
    for dependency in ["htslib"]:
        if dependency in packages:
            if (dependency in ipkgs["outdated"] or "chapmanb/cbl/%s" % dependency in ipkgs["outdated"]
                  or dependency not in ipkgs["current"]):
                _install_pkg_latest(env, dependency, [], brew_cmd, ipkgs)
    if "cpanminus" in packages:
        _install_pkg_latest(env, "cpanminus", [], brew_cmd, ipkgs)
        _install_pkg_latest(env, "samtools-library-0.1", [], brew_cmd, ipkgs)
        cpan.install_packages(env)
    # Ensure paths we may have missed on install are accessible to regular user
    if env.use_sudo:
        paths = ["share", "share/java"]
        for path in paths:
            with quiet():
                test_access = env.safe_run("test -d %s/%s && test -O %s/%s" % (env.system_install, path,
                                                                               env.system_install, path))
            if test_access.failed and env.safe_exists("%s/%s" % (env.system_install, path)):
                env.safe_sudo("chown %s %s/%s" % (env.user, env.system_install, path))