From 403181edb1e12f361944daa82785ae93a6d3e3cd Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcritten@redhat.com>
Date: Thu, 28 Jan 2021 13:20:49 -0500
Subject: [PATCH] Only build the UI with uglifyjs on RHEL 8

The previous expression tested for RHEL or RHEL-like
systems to use uglifyjs. Tighten that up to only RHEL 8
so future RHEL can use rjsmin.

https://pagure.io/freeipa/issue/8669

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
---
 install/ui/util/compile.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/install/ui/util/compile.sh b/install/ui/util/compile.sh
index bdaf2277b8b..01a4e6e74de 100755
--- a/install/ui/util/compile.sh
+++ b/install/ui/util/compile.sh
@@ -111,7 +111,9 @@ fi
 # compile using python rjsmin on most platforms and uglify-js on RHEL 8
 echo "Minimizing: $RDIR/$RELEASE/$LAYER.js"
 echo "Target file: $OUTPUT_FILE"
-if [[ "$ID" == "rhel" ]] || [[ "$ID_LIKE" =~ "rhel" ]]; then
+if [[ ("$ID" == "rhel" || "$ID_LIKE" =~ "rhel")
+      && "$VERSION_ID" =~ "8." ]];
+then
     echo "Minifier: uglifyjs"
     uglifyjs < $RDIR/$RELEASE/$LAYER.js > $OUTPUT_FILE
 else
