Blame 0038-dracut.sh-early-check-for-bash-version.patch

Harald Hoyer 0840a3
From ee44f6297293f895f2e446690a19e7114eff7ae8 Mon Sep 17 00:00:00 2001
Harald Hoyer 0840a3
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 0840a3
Date: Thu, 9 Jul 2015 19:44:30 +0200
Harald Hoyer 0840a3
Subject: [PATCH] dracut.sh: early check for bash version
Harald Hoyer 0840a3
Harald Hoyer 0840a3
---
Harald Hoyer 0840a3
 dracut.sh | 13 +++++++------
Harald Hoyer 0840a3
 1 file changed, 7 insertions(+), 6 deletions(-)
Harald Hoyer 0840a3
Harald Hoyer 0840a3
diff --git a/dracut.sh b/dracut.sh
Harald Hoyer 0840a3
index 77da887..b7456dc 100755
Harald Hoyer 0840a3
--- a/dracut.sh
Harald Hoyer 0840a3
+++ b/dracut.sh
Harald Hoyer 0840a3
@@ -22,6 +22,13 @@
Harald Hoyer 0840a3
 #
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
 # store for logging
Harald Hoyer 0840a3
+
Harald Hoyer 0840a3
+# Verify bash version, current minimum is 4
Harald Hoyer 0840a3
+if (( BASH_VERSINFO[0] < 4 )); then
Harald Hoyer 0840a3
+    printf -- 'You need at least Bash 4 to use dracut, sorry.' >&2
Harald Hoyer 0840a3
+    exit 1
Harald Hoyer 0840a3
+fi
Harald Hoyer 0840a3
+
Harald Hoyer 0840a3
 dracut_args=( "$@" )
Harald Hoyer 0840a3
 readonly dracut_cmd="$(readlink -f $0)"
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
@@ -828,12 +835,6 @@ if ! [[ $print_cmdline ]]; then
Harald Hoyer 0840a3
     rm -fr -- ${initdir}/*
Harald Hoyer 0840a3
 fi
Harald Hoyer 0840a3
 
Harald Hoyer 0840a3
-# Verify bash version, current minimum is 4
Harald Hoyer 0840a3
-if (( BASH_VERSINFO[0] < 4 )); then
Harald Hoyer 0840a3
-    dfatal 'You need at least Bash 4 to use dracut, sorry.'
Harald Hoyer 0840a3
-    exit 1
Harald Hoyer 0840a3
-fi
Harald Hoyer 0840a3
-
Harald Hoyer 0840a3
 dracutfunctions=$dracutbasedir/dracut-functions.sh
Harald Hoyer 0840a3
 export dracutfunctions
Harald Hoyer 0840a3