diff options
author | Leandro A. F. Pereira <leandro.pereira@microsoft.com> | 2019-06-22 01:52:48 -0700 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2019-06-22 01:52:48 -0700 |
commit | 268e1e138732b7bec8f9b89c624dee75c68a7028 (patch) | |
tree | 68675823ae111ca4c106b5f92abd670675741349 /init-distro-rid.sh | |
parent | f55135711f21c7c60ebaf9653e7d97486085a649 (diff) | |
download | coreclr-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-x | init-distro-rid.sh | 8 |
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 |