Blame 0066-dracut-functions.sh-mksubdirs-check-for-dir-existenc.patch

Harald Hoyer 53e990
From 68966a1d7e6dc9d6be054effa62d61836704714b Mon Sep 17 00:00:00 2001
Harald Hoyer 53e990
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 53e990
Date: Fri, 22 Jun 2012 08:58:39 +0200
Harald Hoyer 53e990
Subject: [PATCH] dracut-functions.sh: mksubdirs(): check for dir existence
Harald Hoyer 53e990
 first
Harald Hoyer 53e990
Harald Hoyer 53e990
---
Harald Hoyer 53e990
 dracut-functions.sh |    2 +-
Harald Hoyer 53e990
 1 file changed, 1 insertion(+), 1 deletion(-)
Harald Hoyer 53e990
Harald Hoyer 53e990
diff --git a/dracut-functions.sh b/dracut-functions.sh
Harald Hoyer 53e990
index ace5a0b..3b562e7 100755
Harald Hoyer 53e990
--- a/dracut-functions.sh
Harald Hoyer 53e990
+++ b/dracut-functions.sh
Harald Hoyer 53e990
@@ -74,7 +74,7 @@ fi
Harald Hoyer 53e990
 
Harald Hoyer 53e990
 # Create all subdirectories for given path without creating the last element.
Harald Hoyer 53e990
 # $1 = path
Harald Hoyer 53e990
-mksubdirs() { mkdir -m 0755 -p ${1%/*}; }
Harald Hoyer 53e990
+mksubdirs() { [[ -e ${1%/*} ]] || mkdir -m 0755 -p ${1%/*}; }
Harald Hoyer 53e990
 
Harald Hoyer 53e990
 # Version comparision function.  Assumes Linux style version scheme.
Harald Hoyer 53e990
 # $1 = version a