<commit_before>#!/bin/bash
#
# This script is library for shell scripts used in Azure Linux Automation.
# Author: <NAME>
# Email	: <EMAIL>
#
#

function get_lis_version ()
{
    lis_version=`modinfo hv_vmbus | grep "^version:"| awk '{print $2}'`
    if [ "$lis_version" == "" ]
    then
        lis_version="Default_LIS"
    fi
    echo $lis_version
}

function get_host_version ()
{
    dmesg | grep "Host Build" | sed "s/.*Host Build://"| awk '{print  $1}'| sed "s/;//"
}

function check_exit_status ()
{
    exit_status=$?
    message=$1

    if [ $exit_status -ne 0 ]; then
        echo "$message: Failed (exit code: $exit_status)" 
        if [ "$2" == "exit" ]
        then
            exit $exit_status
        fi 
    else
        echo "$message: Success" 
    fi
}

function detect_linux_ditribution_version()
{
    local  distro_version=`cat /etc/*release*|sed 's/"//g'|grep "VERSION_ID="| sed 's/VERSION_ID=//'| sed 's/\r//'`
    echo $distro_version
}

function detect_linux_ditribution()
{
    local  linux_ditribution=`cat /etc/*release*|sed 's/"//g'|grep "^ID="| sed 's/ID=//'`
    local temp_text=`cat /etc/*release*`
    if [ "$linux_ditribution" == "" ]
    then
        if echo "$temp_text" | grep -qi "ol"; then
            linux_ditribution='oracle'
        elif echo "$temp_text" | grep -qi "Ubuntu"; then
            linux_ditribution='ubuntu'
        elif echo "$temp_text" | grep -qi "SUSE Linux"; then
            linux_ditribution='suse'
        elif echo "$temp_text" | grep -qi "openSUSE"; then
            linux_ditribution='opensuse'
        elif echo "$temp_text" | grep -qi "centos"; then
            linux_ditribution='centos'
        elif echo "$temp_text" | grep -qi "Oracle"; then
            linux_ditribution='oracle'
        elif echo "$temp_text" | grep -qi "Red Hat"; then
            linux_ditribution='rhel'
        else
            linux_ditribution='unknown'
        fi
    fi
    echo "${linux_ditribution^}"
}

function updaterepos()
{
    ditribution=$(detect_linux_ditribution)
    case "$ditribution" in
        oracle|rhel|centos)
            yum makecache
            ;;
    
        ubuntu)
            apt-get update
            ;;
         <commit_msg>Updated distro names<commit_after>#!/bin/bash
#
# This script is library for shell scripts used in Azure Linux Automation.
# Author: <NAME>
# Email	: <EMAIL>
#
#

function get_lis_version ()
{
    lis_version=`modinfo hv_vmbus | grep "^version:"| awk '{print $2}'`
    if [ "$lis_version" == "" ]
    then
        lis_version="Default_LIS"
    fi
    echo $lis_version
}

function get_host_version ()
{
    dmesg | grep "Host Build" | sed "s/.*Host Build://"| awk '{print  $1}'| sed "s/;//"
}

function check_exit_status ()
{
    exit_status=$?
    message=$1

    if [ $exit_status -ne 0 ]; then
        echo "$message: Failed (exit code: $exit_status)" 
        if [ "$2" == "exit" ]
        then
            exit $exit_status
        fi 
    else
        echo "$message: Success" 
    fi
}

function detect_linux_ditribution_version()
{
    local  distro_version=`cat /etc/*release*|sed 's/"//g'|grep "VERSION_ID="| sed 's/VERSION_ID=//'| sed 's/\r//'`
    echo $distro_version
}

function detect_linux_ditribution()
{
    local  linux_ditribution=`cat /etc/*release*|sed 's/"//g'|grep "^ID="| sed 's/ID=//'`
    local temp_text=`cat /etc/*release*`
    if [ "$linux_ditribution" == "" ]
    then
        if echo "$temp_text" | grep -qi "ol"; then
            linux_ditribution='Oracle'
        elif echo "$temp_text" | grep -qi "Ubuntu"; then
            linux_ditribution='Ubuntu'
        elif echo "$temp_text" | grep -qi "SUSE"; then
            linux_ditribution='SUSE'
        elif echo "$temp_text" | grep -qi "openSUSE"; then
            linux_ditribution='OpenSUSE'
        elif echo "$temp_text" | grep -qi "centos"; then
            linux_ditribution='CentOS'
        elif echo "$temp_text" | grep -qi "Oracle"; then
            linux_ditribution='Oracle'
        elif echo "$temp_text" | grep -qi "Red Hat"; then
            linux_ditribution='RHEL'
        else
            linux_ditribution='unknown'
        fi
    fi
    echo "${linux_ditribution^}"
}

function updaterepos()
{
    ditribution=$(detect_linux_ditribution)
    case "$ditribution" in
        oracle|rhel|centos)
            yum makecache
            ;;
    
        ubuntu)
            apt-get update
            ;;
         
{'fraction_non_alphanumeric': 0.13764998868009962, 'fraction_numerical': 0.0022639800769753225, 'mean_word_length': 2.301943198804185, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3805463', 'n_tokens_mistral': 1580, 'n_tokens_neox': 1427, 'n_words': 357}