<commit_before>#!/bin/bash

spec=$1

set -e
set -o pipefail

function echolog() {
    echo "`date -u '+%Y%m%d-%H:%M:%S'` COCKPIT GUEST: $@"
}

BASE_PCKGS="avocado nodejs npm bind-utils freeipa-client sssd"

if ! rpm -q $BASE_PCKGS >& /dev/null; then
    if cat /etc/redhat-release | grep -sq "Red Hat"; then
        echolog "Setting up repositories for RHEL"
        curl https://copr.fedoraproject.org/coprs/lmr/Autotest/repo/epel-7/lmr-Autotest-epel-7.repo > /etc/yum.repos.d/lmr-Autotest-epel-7.repo
        yum -y install https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
    elif cat /etc/redhat-release | grep -sq "Fedora"; then
        echolog "Setting up repositories for Fedora"
        yum -y -q install yum-plugin-copr
        yum -y -q copr enable lmr/Autotest
    else
        echolog "Can't setup repositories for base packages: Unknown OS"
        exit 10
    fi
fi

function yum_install() {
    yum -y install "$@" | (grep -v "already installed and latest version\|Nothing to do\|Loaded plugins:" || true)
}

function yum_builddep() {
    yum-builddep -y "$@" | (grep -v -- "--> Already installed : \|Getting requirements for\|No uninstalled build requires" || true)
}

echolog "Updating base packages"
yum_install $BASE_PCKGS

echolog "Updating build dependencies"<commit_msg>test-avocado: Added CentOS section for guest-cockpit setup<commit_after>#!/bin/bash

spec=$1

set -e
set -o pipefail

function echolog() {
    echo "`date -u '+%Y%m%d-%H:%M:%S'` COCKPIT GUEST: $@"
}

BASE_PCKGS="avocado nodejs npm bind-utils freeipa-client sssd"

if ! rpm -q $BASE_PCKGS >& /dev/null; then
    if cat /etc/redhat-release | grep -sq "Red Hat"; then
        echolog "Setting up repositories for RHEL"
        curl https://copr.fedoraproject.org/coprs/lmr/Autotest/repo/epel-7/lmr-Autotest-epel-7.repo > /etc/yum.repos.d/lmr-Autotest-epel-7.repo
        yum -y install https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
    elif cat /etc/redhat-release | grep "CentOS"; then
        curl https://copr.fedoraproject.org/coprs/lmr/Autotest/repo/epel-7/lmr-Autotest-epel-7.repo > /etc/yum.repos.d/lmr-Autotest-epel-7.repo
        yum -y install https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
    elif cat /etc/redhat-release | grep -sq "Fedora"; then
        echolog "Setting up repositories for Fedora"
        yum -y -q install yum-plugin-copr
        yum -y -q copr enable lmr/Autotest
    else
        echolog "Can't setup repositories for base packages: Unknown OS"
        exit 10
    fi
fi

function yum_install() {
    yum -y install "$@" | (grep -v "already installed and latest version\|Nothing to do\|Loaded plugins:" || true)
}

function yum_builddep() {
    yum-builddep -y "$@" | (grep -v -- "--> Already installed : \|Getting requirements for\|No uninstalled build requires" || true)
}

echolog "Updating base packages"
yum_install $BASE_PCKGS

echolog "Updating build dependencies"
{'fraction_non_alphanumeric': 0.1363941018766756, 'fraction_numerical': 0.012064343163538873, 'mean_word_length': 3.02834008097166, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 6, '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': '2627561', 'n_tokens_mistral': 1184, 'n_tokens_neox': 1108, 'n_words': 272}