Blame SOURCES/0273-dracut-functions.sh-check-if-dinfo-is-a-function.patch

18971c
From 900550c4e0c2a48a5d0c01db0adb23e73a6aa195 Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Mon, 24 Nov 2014 15:17:45 +0100
18971c
Subject: [PATCH] dracut-functions.sh: check if dinfo is a function
18971c
18971c
If "dinfo" is an executable, dracut-logger.sh would never be sourced.
18971c
18971c
See: https://bugzilla.redhat.com/show_bug.cgi?id=1167082
18971c
(cherry picked from commit 26d14fb3d36d6091f64258a62c49939478405693)
18971c
---
18971c
 dracut-functions.sh | 14 +++++++-------
18971c
 1 file changed, 7 insertions(+), 7 deletions(-)
18971c
18971c
diff --git a/dracut-functions.sh b/dracut-functions.sh
18971c
index 31586ca4..973e2312 100755
18971c
--- a/dracut-functions.sh
18971c
+++ b/dracut-functions.sh
18971c
@@ -169,7 +169,13 @@ srcmods="/lib/modules/$kernel/"
18971c
 }
18971c
 export srcmods
18971c
 
18971c
-if ! type dinfo >/dev/null 2>&1; then
18971c
+# is_func <command>
18971c
+# Check whether $1 is a function.
18971c
+is_func() {
18971c
+    [[ "$(type -t "$1")" = "function" ]]
18971c
+}
18971c
+
18971c
+if ! is_func dinfo >/dev/null 2>&1; then
18971c
     . "$dracutbasedir/dracut-logger.sh"
18971c
     dlog_init
18971c
 fi
18971c
@@ -202,12 +208,6 @@ mksubdirs() {
18971c
     [[ -e ${1%/*} ]] || mkdir -m 0755 -p -- "${1%/*}"
18971c
 }
18971c
 
18971c
-# is_func <command>
18971c
-# Check whether $1 is a function.
18971c
-is_func() {
18971c
-    [[ "$(type -t "$1")" = "function" ]]
18971c
-}
18971c
-
18971c
 # Function prints global variables in format name=value line by line.
18971c
 # $@ = list of global variables' name
18971c
 print_vars() {