Blame SOURCES/0174-dracut-functions.sh-print_vars-fix-for-values-with-s.patch

18971c
From 40a5d2c0291d4ec7d8c501fce8fb9d412235fdbb Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Tue, 20 May 2014 11:27:42 +0200
18971c
Subject: [PATCH] dracut-functions.sh:print_vars() fix for values with spaces
18971c
MIME-Version: 1.0
18971c
Content-Type: text/plain; charset=UTF-8
18971c
Content-Transfer-Encoding: 8bit
18971c
18971c
for a variable with spaces, e.g.:
18971c
EXT_KEYMAPS='backspace keypad euro2'
18971c
18971c
The following would occur:
18971c
print_vars: eval printf -v _value %s '$EXT_KEYMAPS'
18971c
print_vars: printf -v _value %s backspace keypad euro2
18971c
print_vars: [[ -n backspacekeypadeuro2 ]]
18971c
print_vars: printf '%s=\"%s\"\n' EXT_KEYMAPS backspacekeypadeuro2
18971c
18971c
Thanks to Sebastian Köln for the fix!
18971c
18971c
(cherry picked from commit 7a94a4326f0641396125acb2b444b562224457a1)
18971c
---
18971c
 dracut-functions.sh | 2 +-
18971c
 1 file changed, 1 insertion(+), 1 deletion(-)
18971c
18971c
diff --git a/dracut-functions.sh b/dracut-functions.sh
18971c
index cb43f7ad..915f70fa 100755
18971c
--- a/dracut-functions.sh
18971c
+++ b/dracut-functions.sh
18971c
@@ -176,7 +176,7 @@ print_vars() {
18971c
 
18971c
     for _var in "$@"
18971c
     do
18971c
-        eval printf -v _value "%s" "\$$_var"
18971c
+        eval printf -v _value "%s" \""\$$_var"\"
18971c
         [[ ${_value} ]] && printf '%s="%s"\n' "$_var" "$_value"
18971c
     done
18971c
 }