Blame 0069-dracut-functions.sh-inst_simple-do-inst_symlink-for-.patch

Harald Hoyer 53e990
From 7953a6ab718185096e5729482f91b319d4a67e90 Mon Sep 17 00:00:00 2001
Harald Hoyer 53e990
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 53e990
Date: Fri, 22 Jun 2012 15:09:07 +0200
Harald Hoyer 53e990
Subject: [PATCH] dracut-functions.sh:inst_simple() do inst_symlink for
Harald Hoyer 53e990
 symlinks
Harald Hoyer 53e990
Harald Hoyer 53e990
---
Harald Hoyer 53e990
 dracut-functions.sh |   17 ++++++++++-------
Harald Hoyer 53e990
 1 file changed, 10 insertions(+), 7 deletions(-)
Harald Hoyer 53e990
Harald Hoyer 53e990
diff --git a/dracut-functions.sh b/dracut-functions.sh
Harald Hoyer 53e990
index b9ce688..273d2a5 100755
Harald Hoyer 53e990
--- a/dracut-functions.sh
Harald Hoyer 53e990
+++ b/dracut-functions.sh
Harald Hoyer 53e990
@@ -424,18 +424,21 @@ inst_simple() {
Harald Hoyer 53e990
     [[ -f "$1" ]] || return 1
Harald Hoyer 53e990
     strstr "$1" "/" || return 1
Harald Hoyer 53e990
 
Harald Hoyer 53e990
-    local _src=$1 target="${2:-$1}"
Harald Hoyer 53e990
-    if ! [[ -d ${initdir}/$target ]]; then
Harald Hoyer 53e990
-        [[ -e ${initdir}/$target ]] && return 0
Harald Hoyer 53e990
-        [[ -L ${initdir}/$target ]] && return 0
Harald Hoyer 53e990
-        [[ -d "${initdir}/${target%/*}" ]] || inst_dir "${target%/*}"
Harald Hoyer 53e990
+    local _src=$1 _target="${2:-$1}"
Harald Hoyer 53e990
+
Harald Hoyer 53e990
+    [[ -L $_src ]] && return inst_symlink $_src $_target
Harald Hoyer 53e990
+
Harald Hoyer 53e990
+    if ! [[ -d ${initdir}/$_target ]]; then
Harald Hoyer 53e990
+        [[ -e ${initdir}/$_target ]] && return 0
Harald Hoyer 53e990
+        [[ -L ${initdir}/$_target ]] && return 0
Harald Hoyer 53e990
+        [[ -d "${initdir}/${_target%/*}" ]] || inst_dir "${_target%/*}"
Harald Hoyer 53e990
     fi
Harald Hoyer 53e990
     # install checksum files also
Harald Hoyer 53e990
     if [[ -e "${_src%/*}/.${_src##*/}.hmac" ]]; then
Harald Hoyer 53e990
-        inst "${_src%/*}/.${_src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
Harald Hoyer 53e990
+        inst "${_src%/*}/.${_src##*/}.hmac" "${_target%/*}/.${_target##*/}.hmac"
Harald Hoyer 53e990
     fi
Harald Hoyer 53e990
     ddebug "Installing $_src"
Harald Hoyer 53e990
-    cp --reflink=auto --sparse=auto -pfL "$_src" "${initdir}/$target"
Harald Hoyer 53e990
+    cp --reflink=auto --sparse=auto -pfL "$_src" "${initdir}/$_target"
Harald Hoyer 53e990
 }
Harald Hoyer 53e990
 
Harald Hoyer 53e990
 # find symlinks linked to given library file