Blame 0062-dracut-PATCH-Parameter-expansion-occurs-before-comma.patch

Harald Hoyer 55891e
From 9e103df45e4ca2c2392cedf3c9ecb84713962838 Mon Sep 17 00:00:00 2001
Harald Hoyer 55891e
From: John Reiser <jreiser@bitwagon.com>
Harald Hoyer 55891e
Date: Fri, 23 Sep 2011 08:02:23 -0700
Harald Hoyer 55891e
Subject: [PATCH] dracut [PATCH] Parameter expansion occurs before command
Harald Hoyer 55891e
 evaluation.
Harald Hoyer 55891e
Harald Hoyer 55891e
Bash shell expands all ${parameter} before evaluating a command.
Harald Hoyer 55891e
For multiple declarations and assignments within the same 'local' command,
Harald Hoyer 55891e
then new variables or new values that appear towards the left
Harald Hoyer 55891e
do not affect parameter expansion towards the right.
Harald Hoyer 55891e
Harald Hoyer 55891e
--
Harald Hoyer 55891e
John Reiser, jreiser@BitWagon.com
Harald Hoyer 55891e
Harald Hoyer 55891e
>From 507ad6f66fc66f868a9e5fdd3806e012c4022baa Mon Sep 17 00:00:00 2001
Harald Hoyer 55891e
From: John Reiser <jreiser@BitWagon.com>
Harald Hoyer 55891e
Date: Fri, 23 Sep 2011 07:37:43 -0700
Harald Hoyer 55891e
Subject: [PATCH] Parameter expansion occurs before command evaluation.
Harald Hoyer 55891e
Harald Hoyer 55891e
${parameter} on the right is expanded before evaluating "local var=value"
Harald Hoyer 55891e
on the left.
Harald Hoyer 55891e
---
Harald Hoyer 55891e
 dracut-functions |    2 +-
Harald Hoyer 55891e
 1 files changed, 1 insertions(+), 1 deletions(-)
Harald Hoyer 55891e
Harald Hoyer 55891e
diff --git a/dracut-functions b/dracut-functions
Harald Hoyer 55891e
index 5508809..c4f7f61 100755
Harald Hoyer 55891e
--- a/dracut-functions
Harald Hoyer 55891e
+++ b/dracut-functions
Harald Hoyer 55891e
@@ -272,7 +272,7 @@ check_vol_slaves() {
Harald Hoyer 55891e
 inst_dir() {
Harald Hoyer 55891e
     [[ -e ${initdir}"$1" ]] && return 0  # already there
Harald Hoyer 55891e
 
Harald Hoyer 55891e
-    local _dir="$1" _part=${_dir%/*} _file
Harald Hoyer 55891e
+    local _dir="$1" _part="${1%/*}" _file
Harald Hoyer 55891e
     while [[ "$_part" != "${_part%/*}" ]] && ! [[ -e "${initdir}${_part}" ]]; do
Harald Hoyer 55891e
         _dir="$_part $_dir"
Harald Hoyer 55891e
         _part=${_part%/*}