Skip to content

Commit

Permalink
detect-environment: Fixed version detection for RHEL
Browse files Browse the repository at this point in the history
Jenkins failed with "Unknown RHEL Server version: 8.10" because the
`detect-environment` script did not take into account that the minor
version number can have more than one decimal.

Ticket: ENT-11808
Changelog: None
Signed-off-by: Lars Erik Wik <[email protected]>
(cherry picked from commit 4f0a6ba)
  • Loading branch information
larsewi committed May 23, 2024
1 parent ac0cc67 commit 4a5a95c
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions build-scripts/detect-environment
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,11 @@ detect_distribution()
"Red Hat Enterprise Linux Server release "*)
VER=${REL#Red Hat Enterprise Linux Server release }
VER=${VER% \(*};
case "$VER" in
[0-9].[0-9]);;
*)
if ! echo "$VER" | egrep '^[0-9]+.[0-9]+$' > /dev/null
then
echo "Unknown RHEL Server version: $VER"
exit 42;;
esac
exit 42
fi

OS=rhel
OS_VERSION="$VER"
Expand All @@ -130,12 +129,11 @@ detect_distribution()
"Red Hat Enterprise Linux release "*)
VER=${REL#Red Hat Enterprise Linux release }
VER=${VER% \(*};
case "$VER" in
[0-9].[0-9]);;
*)
if ! echo "$VER" | egrep '^[0-9]+.[0-9]+$' > /dev/null
then
echo "Unknown RHEL Server version: $VER"
exit 42;;
esac
exit 42
fi

OS=rhel
OS_VERSION="$VER"
Expand Down

0 comments on commit 4a5a95c

Please sign in to comment.