<commit_before># Run this script as an admin user (having 'sudo' privileges)
#  = 'admin' on debian, 'ubuntu' on ubuntu

# Depending on how the target host is set up, a password might be
# required in order to perform some of these functions. We try to
# ensure that even if a password is needed the first time around, it
# won't be needed the second and following times.

set -e
# Current directory = home dir for admin user

OPENTREE_HOST=$1
OPENTREE_USER=$2
CERTIFICATE_FILE=$3
CERTIFICATE_KEY_FILE=$4

if [ x$OPENTREE_USER = x ]; then
    OPENTREE_USER=opentree
fi

if ! sudo test -r "$CERTIFICATE_FILE"; then
    echo "** Missing "$CERTIFICATE_FILE" - must be copied manually"
elif ! sudo test -r "$CERTIFICATE_KEY_FILE"; then
    echo "** Missing "$CERTIFICATE_KEY_FILE" - must be copied manually"
fi

APTGET="sudo apt-get -q --assume-yes --no-install-recommends"

function apt_get_install {
    if [ ! -r .updated ]; then
	$APTGET update
	touch .updated
    fi
    $APTGET install $*
}

function apt_get_install_one
{
    PKG=$1
    if ! dpkg -s "$PKG" >/dev/null 2>&1 ; then
	apt_get_install $PKG
    fi
}

# ---------- UPDATE ----------

if [ `which dialog`x = x ]; then
    # I was hoping this would help with apache2's configure step, but it doesn't
    apt_get_install dialog
fi

# ---------- RSYNC ----------
if [ `which rsync`x = x ]; then
    apt_get_install rsync
fi

# ---------- GCC (for some python packages) ----------
if [ `which gcc`x = x ]; then
    apt_get_install gcc
fi


# ---------- G++ (for NCL, the nexus, newick converter used by the curation tool's import) ----------
if [ `which g++`x = x ]; then
    apt_get_install g++
fi

# ---------- make (for NCL, the nexus, newick converter used by the curation tool's import) ----------
if [ `which make`x = x ]; then
    apt_get_install make
fi

# ---------- autoconf and automake for NCL (curation dependency) ----------
if [ `which autoconf`x = x ]; then
    apt_get_install autotools-dev
fi
# ---------- autoconf and automake for NCL (curation dependency) ----------
if [ `which automake`x = x ]; then
    apt_get_install automake
fi

# ---------- for otcetera  ----------------
apt_get_install_one libboost-dev
apt_get_install_one libboost-filesystem-dev
apt_get_install_one libboost-program-options-dev
apt_get_install_one libboost-system-dev
apt_get_install_one libtool
apt_get_install_one psmisc # for killall

# ---------- for restbed (otcetera web services dependency) ----------
apt_get_install_one cmake
apt_get_install_one libssl-dev
apt_get_install_one libcurl4-openssl-dev

# ---------- for running otc-tol-ws ------------------
# apt_get_install_one daemonize

# ---------- PYTHON-DEV (for some python packages) ----------
if [ ! -r /usr/include/*/Python.h ]; then
    apt_get_install python-dev
fi
# -----G++ (for NCL, the nexus, newick converter used by the curation tool's import) -----
if [ `which g++`x = x ]; then
    apt_get_install g++
fi
# ---------- autoconf and automake for NCL (curation dependency) ----------
if [ `which autoconf`x = x ]; then
    apt_get_install autotools-dev
fi
# ---------- autoconf and automake for NCL (curation dependency) ----------<commit_msg>Revert "comment out BDR's daemonize install"<commit_after># Run this script as an admin user (having 'sudo' privileges)
#  = 'admin' on debian, 'ubuntu' on ubuntu

# Depending on how the target host is set up, a password might be
# required in order to perform some of these functions. We try to
# ensure that even if a password is needed the first time around, it
# won't be needed the second and following times.

set -e
# Current directory = home dir for admin user

OPENTREE_HOST=$1
OPENTREE_USER=$2
CERTIFICATE_FILE=$3
CERTIFICATE_KEY_FILE=$4

if [ x$OPENTREE_USER = x ]; then
    OPENTREE_USER=opentree
fi

if ! sudo test -r "$CERTIFICATE_FILE"; then
    echo "** Missing "$CERTIFICATE_FILE" - must be copied manually"
elif ! sudo test -r "$CERTIFICATE_KEY_FILE"; then
    echo "** Missing "$CERTIFICATE_KEY_FILE" - must be copied manually"
fi

APTGET="sudo apt-get -q --assume-yes --no-install-recommends"

function apt_get_install {
    if [ ! -r .updated ]; then
	$APTGET update
	touch .updated
    fi
    $APTGET install $*
}

function apt_get_install_one
{
    PKG=$1
    if ! dpkg -s "$PKG" >/dev/null 2>&1 ; then
	apt_get_install $PKG
    fi
}

# ---------- UPDATE ----------

if [ `which dialog`x = x ]; then
    # I was hoping this would help with apache2's configure step, but it doesn't
    apt_get_install dialog
fi

# ---------- RSYNC ----------
if [ `which rsync`x = x ]; then
    apt_get_install rsync
fi

# ---------- GCC (for some python packages) ----------
if [ `which gcc`x = x ]; then
    apt_get_install gcc
fi


# ---------- G++ (for NCL, the nexus, newick converter used by the curation tool's import) ----------
if [ `which g++`x = x ]; then
    apt_get_install g++
fi

# ---------- make (for NCL, the nexus, newick converter used by the curation tool's import) ----------
if [ `which make`x = x ]; then
    apt_get_install make
fi

# ---------- autoconf and automake for NCL (curation dependency) ----------
if [ `which autoconf`x = x ]; then
    apt_get_install autotools-dev
fi
# ---------- autoconf and automake for NCL (curation dependency) ----------
if [ `which automake`x = x ]; then
    apt_get_install automake
fi

# ---------- for otcetera  ----------------
apt_get_install_one libboost-dev
apt_get_install_one libboost-filesystem-dev
apt_get_install_one libboost-program-options-dev
apt_get_install_one libboost-system-dev
apt_get_install_one libtool
apt_get_install_one psmisc # for killall

# ---------- for restbed (otcetera web services dependency) ----------
apt_get_install_one cmake
apt_get_install_one libssl-dev
apt_get_install_one libcurl4-openssl-dev

# ---------- for running otc-tol-ws ------------------
apt_get_install_one daemonize

# ---------- PYTHON-DEV (for some python packages) ----------
if [ ! -r /usr/include/*/Python.h ]; then
    apt_get_install python-dev
fi
# -----G++ (for NCL, the nexus, newick converter used by the curation tool's import) -----
if [ `which g++`x = x ]; then
    apt_get_install g++
fi
# ---------- autoconf and automake for NCL (curation dependency) ----------
if [ `which autoconf`x = x ]; then
    apt_get_install autotools-dev
fi
# ---------- autoconf and automake for NCL (curation dependency) ----------
{'fraction_non_alphanumeric': 0.16883728228463832, 'fraction_numerical': 0.0028244155029028715, 'mean_word_length': 2.619534355479841, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1731409', 'n_tokens_mistral': 2154, 'n_tokens_neox': 2056, 'n_words': 693}