Skip to content

Commit

Permalink
Fix generation of RID on distros that do not set VERSION_ID (dotnet#2…
Browse files Browse the repository at this point in the history
…5034)

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.
  • Loading branch information
lpereira authored and jkotas committed Jun 22, 2019
1 parent f551357 commit 268e1e1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion init-distro-rid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 268e1e1

Please sign in to comment.