diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2017-10-23 23:03:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-23 23:03:23 +0200 |
commit | 33159233fd161877ffe37187bf06689fe0e8bea2 (patch) | |
tree | eee10c0fd73837ab80ec3263c2f38fecfb8a4813 /build-test.sh | |
parent | 458c90a363b22fb29f6581610d5349bf06e17971 (diff) | |
download | coreclr-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-x | build-test.sh | 23 |
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() |