<commit_before>#!/usr/bin/env bash

initHostDistroRid()
{
    __HostDistroRid=""

    # Some OS groups should default to use the portable packages
    if [ "$__BuildOS" == "OSX" ]; then
        __PortableBuild=1
    fi

    if [ "$__HostOS" == "Linux" ]; then
        if [ -e /etc/redhat-release ]; then
            __PortableBuild=1
        elif [ -e /etc/os-release ]; then
            source /etc/os-release
            if [[ $ID == "alpine" ]]; then
                __HostDistroRid="linux-musl-$__HostArch"
            else
                __PortableBuild=1
                __HostDistroRid="$ID.$VERSION_ID-$__HostArch"
            fi
        fi
    elif [ "$__HostOS" == "FreeBSD" ]; then
        __freebsd_version=`sysctl -n kern.osrelease | cut -f1 -d'.'`
        __HostDistroRid="freebsd.$__freebsd_version-$__HostArch"
    fi

    # Portable builds target the base RID
    if [ "$__PortableBuild" == 1 ]; then
        if [ "$__BuildOS" == "OSX" ]; then
            export __HostDistroRid="osx-$__BuildArch"
        elif [ "$__BuildOS" == "Linux" ]; then
            export __HostDistroRid="linux-$__BuildArch"
        fi
    fi

    if [ "$__HostDistroRid" == "" ]; then
        echo "WARNING: Cannot determine runtime id for current distro."
    fi

    echo "Setting __HostDistroRid to $__HostDistroRid"
}

initTargetDistroRid()
{
    if [ $__CrossBuild == 1 ]; then
        if [ "$__BuildOS" == "Linux" ]; then
            if [ ! -e $ROOTFS_DIR/etc/os-release ]; then
                if [ -e $ROOTFS_DIR/android_platform ]; then
                    source $ROOTFS_DIR/android_platform
                    export __DistroRid="$RID"
                else
                    echo "WARNING: Cannot determine runtime id for current distro."
                    export __DistroRid=""
                fi
            else
                source $ROOTFS_DIR/etc/os-release
                export __DistroRid="$ID.$VERSION_ID-$__BuildArch"
            fi
        fi
    else
        export __DistroRid="$__HostDistroRid"
    fi

    if [ "$ID.$VERSION_ID" == "ubuntu.16.04" ]; then
     export __DistroRid="ubuntu.14.04-$__BuildArch"
    fi

    # Portable builds target the base RID
    if [ "$__PortableBuild" == 1 ]; then
        if [ "$__BuildOS" == "Linux" ]; then
            export __DistroRid="linux-$__BuildArch"
            export __RuntimeId="linux-$__BuildArch"
        elif [ "$__BuildOS" == "OSX" ]; then
            export __DistroRid="osx-$__BuildArch"
            export __RuntimeId="osx-$__BuildArch"
        fi
    fi

    echo "__DistroRid: " $__DistroRid
}
<commit_msg>Specify value of __RuntimeId for non-portable Linux test builds in build-test.sh (#21777)<commit_after>#!/usr/bin/env bash

initHostDistroRid()
{
    __HostDistroRid=""

    # Some OS groups should default to use the portable packages
    if [ "$__BuildOS" == "OSX" ]; then
        __PortableBuild=1
    fi

    if [ "$__HostOS" == "Linux" ]; then
        if [ -e /etc/redhat-release ]; then
            __PortableBuild=1
        elif [ -e /etc/os-release ]; then
            source /etc/os-release
            if [[ $ID == "alpine" ]]; then
                __HostDistroRid="linux-musl-$__HostArch"
            else
                __PortableBuild=1
                __HostDistroRid="$ID.$VERSION_ID-$__HostArch"
            fi
        fi
    elif [ "$__HostOS" == "FreeBSD" ]; then
        __freebsd_version=`sysctl -n kern.osrelease | cut -f1 -d'.'`
        __HostDistroRid="freebsd.$__freebsd_version-$__HostArch"
    fi

    # Portable builds target the base RID
    if [ "$__PortableBuild" == 1 ]; then
        if [ "$__BuildOS" == "OSX" ]; then
            export __HostDistroRid="osx-$__BuildArch"
        elif [ "$__BuildOS" == "Linux" ]; then
            export __HostDistroRid="linux-$__BuildArch"
        fi
    fi

    if [ "$__HostDistroRid" == "" ]; then
        echo "WARNING: Cannot determine runtime id for current distro."
    fi

    echo "Setting __HostDistroRid to $__HostDistroRid"
}

initTargetDistroRid()
{
    if [ $__CrossBuild == 1 ]; then
        if [ "$__BuildOS" == "Linux" ]; then
            if [ ! -e $ROOTFS_DIR/etc/os-release ]; then
                if [ -e $ROOTFS_DIR/android_platform ]; then
                    source $ROOTFS_DIR/android_platform
                    export __DistroRid="$RID"
                else
                    echo "WARNING: Cannot determine runtime id for current distro."
                    export __DistroRid=""
                fi
            else
                source $ROOTFS_DIR/etc/os-release
                export __DistroRid="$ID.$VERSION_ID-$__BuildArch"
            fi
        fi
    else
        export __DistroRid="$__HostDistroRid"
        export __RuntimeId="$__HostDistroRid"
    fi

    if [ "$ID.$VERSION_ID" == "ubuntu.16.04" ]; then
     export __DistroRid="ubuntu.14.04-$__BuildArch"
    fi

    # Portable builds target the base RID
    if [ "$__PortableBuild" == 1 ]; then
        if [ "$__BuildOS" == "Linux" ]; then
            export __DistroRid="linux-$__BuildArch"
            export __RuntimeId="linux-$__BuildArch"
        elif [ "$__BuildOS" == "OSX" ]; then
            export __DistroRid="osx-$__BuildArch"
            export __RuntimeId="osx-$__BuildArch"
        fi
    fi

    echo "__DistroRid: " $__DistroRid
}

{'fraction_non_alphanumeric': 0.1157180550320392, 'fraction_numerical': 0.006596306068601583, 'mean_word_length': 1.9047619047619047, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7005432', 'n_tokens_mistral': 1731, 'n_tokens_neox': 1635, 'n_words': 381}