summaryrefslogtreecommitdiff
path: root/build-test.sh
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2017-10-23 23:03:23 +0200
committerGitHub <noreply@github.com>2017-10-23 23:03:23 +0200
commit33159233fd161877ffe37187bf06689fe0e8bea2 (patch)
treeeee10c0fd73837ab80ec3263c2f38fecfb8a4813 /build-test.sh
parent458c90a363b22fb29f6581610d5349bf06e17971 (diff)
downloadcoreclr-33159233fd161877ffe37187bf06689fe0e8bea2.tar.gz
coreclr-33159233fd161877ffe37187bf06689fe0e8bea2.tar.bz2
coreclr-33159233fd161877ffe37187bf06689fe0e8bea2.zip
Fix RID extraction in packages and test build for Alpine (#14656)
* Fix RID extraction in packages and test build for Alpine The host RID extraction in build-packages.sh and build-test.sh was not matching the one in build.sh * Reflect feedback
Diffstat (limited to 'build-test.sh')
-rwxr-xr-xbuild-test.sh23
1 files changed, 19 insertions, 4 deletions
diff --git a/build-test.sh b/build-test.sh
index 48d9a1f604..e560faf3f5 100755
--- a/build-test.sh
+++ b/build-test.sh
@@ -2,15 +2,30 @@
initHostDistroRid()
{
+ __HostDistroRid=""
if [ "$__HostOS" == "Linux" ]; then
- if [ ! -e /etc/os-release ]; then
- echo "WARNING: Can not determine runtime id for current distro."
- __HostDistroRid=""
- else
+ if [ -e /etc/os-release ]; then
source /etc/os-release
+ if [[ $ID == "alpine" ]]; then
+ # remove the last version digit
+ VERSION_ID=${VERSION_ID%.*}
+ fi
__HostDistroRid="$ID.$VERSION_ID-$__HostArch"
+ elif [ -e /etc/redhat-release ]; then
+ local redhatRelease=$(</etc/redhat-release)
+ if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux Server release 6."* ]]; then
+ __HostDistroRid="rhel.6-$__HostArch"
+ fi
fi
fi
+ if [ "$__HostOS" == "FreeBSD" ]; then
+ __freebsd_version=`sysctl -n kern.osrelease | cut -f1 -d'.'`
+ __HostDistroRid="freebsd.$__freebsd_version-$__HostArch"
+ fi
+
+ if [ "$__HostDistroRid" == "" ]; then
+ echo "WARNING: Cannot determine runtime id for current distro."
+ fi
}
initTargetDistroRid()