<commit_before>#!/bin/bash

OS=$(/bin/bash /tmp/os-detect.sh ID)
CODENAME=$(/bin/bash /tmp/os-detect.sh CODENAME)

# this is a temporary workaround
if [ "$OS" == 'ubuntu' ]; then
    while [ ! -f /var/lib/cloud/instance/boot-finished ] ; do
        sleep 10
        echo "sleeping for 10 seconds while cloud-init is running"
    done
    while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1; do
        sleep 10
        echo "Waiting while apt is ran by cloud-init"
    done
fi

if [[ ! -d /var/puppet-init/ ]]; then
    mkdir /var/puppet-init
    echo "Created directory /var/puppet-init"

    if [ "$OS" == 'debian' ] || [ "$OS" == 'ubuntu' ]; then
        sed -i 's/^mesg n$/tty -s \&\& mesg n/g' /root/.profile
    fi
fi

if [[ ! -f /var/puppet-init/initial-setup-repo-update ]]; then
    if [ "$OS" == 'debian' ] || [ "$OS" == 'ubuntu' ]; then
        echo "Running initial-setup apt-get update"
        # apt-get update >/dev/null
        apt-get update && apt-get dist-upgrade -y
        apt-get -y autoremove
        touch /var/puppet-init/initial-setup-repo-update
        echo "Finished running initial-setup apt-get update"
    elif [[ "$OS" == 'centos' ]]; then
        echo "Running initial-setup yum update"
        yum update -y 
        echo "Finished running initial-setup yum update"

        echo "Installing basic development tools (CentOS)"
        yum -y groupinstall "Development Tools"
        echo "Finished installing basic development tools (CentOS)"
        touch /var/puppet-init/initial-setup-repo-update
    fi
fi

if [[ "$OS" == 'ubuntu' && ("$CODENAME" == 'lucid' || "$CODENAME" == 'precise') && ! -f /var/puppet-init/ubuntu-required-libraries ]]; then
    echo 'Installing basic curl packages (Ubuntu only)'
    apt-get install -y curl unzip libcurl3 libcurl4-gnutls-dev 
    echo 'Finished installing basic curl packages (Ubuntu only)'
<commit_msg>skipping the ubuntu version check when installing needed tools<commit_after>#!/bin/bash

OS=$(/bin/bash /tmp/os-detect.sh ID)
CODENAME=$(/bin/bash /tmp/os-detect.sh CODENAME)

# this is a temporary workaround
if [ "$OS" == 'ubuntu' ]; then
    while [ ! -f /var/lib/cloud/instance/boot-finished ] ; do
        sleep 10
        echo "sleeping for 10 seconds while cloud-init is running"
    done
    while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1; do
        sleep 10
        echo "Waiting while apt is ran by cloud-init"
    done
fi

if [[ ! -d /var/puppet-init/ ]]; then
    mkdir /var/puppet-init
    echo "Created directory /var/puppet-init"

    if [ "$OS" == 'debian' ] || [ "$OS" == 'ubuntu' ]; then
        sed -i 's/^mesg n$/tty -s \&\& mesg n/g' /root/.profile
    fi
fi

if [[ ! -f /var/puppet-init/initial-setup-repo-update ]]; then
    if [ "$OS" == 'debian' ] || [ "$OS" == 'ubuntu' ]; then
        echo "Running initial-setup apt-get update"
        # apt-get update >/dev/null
        apt-get update && apt-get dist-upgrade -y
        apt-get -y autoremove
        touch /var/puppet-init/initial-setup-repo-update
        echo "Finished running initial-setup apt-get update"
    elif [[ "$OS" == 'centos' ]]; then
        echo "Running initial-setup yum update"
        yum update -y 
        echo "Finished running initial-setup yum update"

        echo "Installing basic development tools (CentOS)"
        yum -y groupinstall "Development Tools"
        echo "Finished installing basic development tools (CentOS)"
        touch /var/puppet-init/initial-setup-repo-update
    fi
fi

if [[ "$OS" == 'ubuntu' && ! -f /var/puppet-init/ubuntu-required-libraries ]]; then
    echo 'Installing basic curl packages (Ubuntu only)'
    apt-get install -y curl unzip libcurl3 libcurl4-gnutls-dev 
    echo 'Finished installing basic curl packages (Ubuntu only)'

{'fraction_non_alphanumeric': 0.14107000266169817, 'fraction_numerical': 0.005323396326856534, 'mean_word_length': 2.5088702147525677, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3673695', 'n_tokens_mistral': 1325, 'n_tokens_neox': 1218, 'n_words': 370}