summaryrefslogtreecommitdiff
path: root/init-distro-rid.sh
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro.pereira@microsoft.com>2019-06-22 01:52:48 -0700
committerJan Kotas <jkotas@microsoft.com>2019-06-22 01:52:48 -0700
commit268e1e138732b7bec8f9b89c624dee75c68a7028 (patch)
tree68675823ae111ca4c106b5f92abd670675741349 /init-distro-rid.sh
parentf55135711f21c7c60ebaf9653e7d97486085a649 (diff)
downloadcoreclr-268e1e138732b7bec8f9b89c624dee75c68a7028.tar.gz
coreclr-268e1e138732b7bec8f9b89c624dee75c68a7028.tar.bz2
coreclr-268e1e138732b7bec8f9b89c624dee75c68a7028.zip
Fix generation of RID on distros that do not set VERSION_ID (#25034)
Rolling-release distros do not set this variable, leading to invalid RIDs such as "gentoo.-x64", which causes build failures. Omit VERSION_ID (and the period preceding it) when unset, so it's consistent with host and PlatformAbstractions. Fixes #19769.
Diffstat (limited to 'init-distro-rid.sh')
-rwxr-xr-xinit-distro-rid.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/init-distro-rid.sh b/init-distro-rid.sh
index dc9bb04e36..49d8981c4f 100755
--- a/init-distro-rid.sh
+++ b/init-distro-rid.sh
@@ -56,7 +56,13 @@ initNonPortableDistroRid()
VERSION_ID=${VERSION_ID%.*}
fi
- nonPortableBuildID="${ID}.${VERSION_ID}-${buildArch}"
+ if [ -z ${VERSION_ID+x} ]; then
+ # Rolling release distros do not set VERSION_ID, so omit
+ # it here to be consistent with everything else.
+ nonPortableBuildID="${ID}-${buildArch}"
+ else
+ nonPortableBuildID="${ID}.${VERSION_ID}-${buildArch}"
+ fi
fi
elif [ -e "${rootfsDir}/etc/redhat-release" ]; then