[flang-commits] [flang] c719a85 - [flang] Relax the Bash version check

Andrzej Warzynski via flang-commits flang-commits at lists.llvm.org
Thu Jan 13 09:04:58 PST 2022


Author: Andrzej Warzynski
Date: 2022-01-13T17:04:02Z
New Revision: c719a8596d01cef9b54f0585bd2d68d657d8659a

URL: https://github.com/llvm/llvm-project/commit/c719a8596d01cef9b54f0585bd2d68d657d8659a
DIFF: https://github.com/llvm/llvm-project/commit/c719a8596d01cef9b54f0585bd2d68d657d8659a.diff

LOG: [flang] Relax the Bash version check

As per https://github.com/flang-compiler/f18-llvm-project/issues/1344,
the `flang` bash script works fine with 4.4.19 and requiring
4.4.23 is too restrictive. Rather than keep updating the patch level,
this patch removes this particular check (so that it will only check the
major and minor versions instead).

As this is both rather straightforward and urgent, I'm merging this
without a review.

Added: 
    

Modified: 
    flang/tools/f18/flang

Removed: 
    


################################################################################
diff  --git a/flang/tools/f18/flang b/flang/tools/f18/flang
index 1d657ae64c742..3434bd3e60a4c 100755
--- a/flang/tools/f18/flang
+++ b/flang/tools/f18/flang
@@ -13,7 +13,7 @@
 #   * use the external compiler (defined via FLANG_FC environment variable) to
 #   compile the unparsed source files
 #
-# Tested with Bash 4.4.23. This script will exit immediately if you use an
+# Tested with Bash 4.4. This script will exit immediately if you use an
 # older version of Bash.
 #===------------------------------------------------------------------------===#
 set -euo pipefail
@@ -31,10 +31,10 @@ PRINT_VERSION="False"
 # === check_bash_version ======================================================
 #
 # Checks the Bash version that's used to run this script. Exits immediately if
-# it's lower than 4.4.23
+# it's lower than 4.4
 # =============================================================================
 check_bash_version() {
-  message="Error: Your Bash is too old. Please use Bash >= 4.4.23"
+  message="Error: Your Bash is too old. Please use Bash >= 4.4"
   # Major version
   [[ "${BASH_VERSINFO[0]:-0}" -lt 4 ]] && echo $message && exit 1
 
@@ -42,11 +42,6 @@ check_bash_version() {
   if [[ "${BASH_VERSINFO[0]}" == 4 ]]; then
     [[ "${BASH_VERSINFO[1]:-0}" -lt 4 ]] && echo $message && exit 1
   fi
-
-  # Patch version
-  if [[ "${BASH_VERSINFO[0]}" == 4 ]] && [[ "${BASH_VERSINFO[1]}" == 4 ]] ; then
-    [[ "${BASH_VERSINFO[2]:-0}" -lt 23 ]] && echo $message && exit 1
-  fi
 }
 
 # === parse_args ==============================================================


        


More information about the flang-commits mailing list