Blame 0070-dracut-functions.sh-inst_decompress-simplify-functio.patch

Harald Hoyer 53e990
From 04569ec8da0a553a7e4dfd37ce1d62508e3441eb 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:45 +0200
Harald Hoyer 53e990
Subject: [PATCH] dracut-functions.sh:inst_decompress() simplify function
Harald Hoyer 53e990
Harald Hoyer 53e990
---
Harald Hoyer 53e990
 dracut-functions.sh |   17 ++---------------
Harald Hoyer 53e990
 1 file changed, 2 insertions(+), 15 deletions(-)
Harald Hoyer 53e990
Harald Hoyer 53e990
diff --git a/dracut-functions.sh b/dracut-functions.sh
Harald Hoyer 53e990
index 273d2a5..9861bb7 100755
Harald Hoyer 53e990
--- a/dracut-functions.sh
Harald Hoyer 53e990
+++ b/dracut-functions.sh
Harald Hoyer 53e990
@@ -773,7 +773,7 @@ inst_libdir_file() {
Harald Hoyer 53e990
 # Function install targets in the same paths inside overlay but decompressed
Harald Hoyer 53e990
 # and without extensions (.gz, .bz2).
Harald Hoyer 53e990
 inst_decompress() {
Harald Hoyer 53e990
-    local _src _dst _realsrc _realdst _cmd
Harald Hoyer 53e990
+    local _src _cmd
Harald Hoyer 53e990
 
Harald Hoyer 53e990
     for _src in $@
Harald Hoyer 53e990
     do
Harald Hoyer 53e990
@@ -782,20 +782,7 @@ inst_decompress() {
Harald Hoyer 53e990
             *.bz2) _cmd='bzip2 -d' ;;
Harald Hoyer 53e990
             *) return 1 ;;
Harald Hoyer 53e990
         esac
Harald Hoyer 53e990
-
Harald Hoyer 53e990
-        if [[ -L ${_src} ]]
Harald Hoyer 53e990
-        then
Harald Hoyer 53e990
-            _realsrc="$(readlink -f ${_src})" # symlink target with extension
Harald Hoyer 53e990
-            _dst="${_src%.*}" # symlink without extension
Harald Hoyer 53e990
-            _realdst="${_realsrc%.*}" # symlink target without extension
Harald Hoyer 53e990
-            mksubdirs "${initdir}/${_src}"
Harald Hoyer 53e990
-            # Create symlink without extension to target without extension.
Harald Hoyer 53e990
-            ln -sfn "${_realdst}" "${initdir}/${_dst}"
Harald Hoyer 53e990
-        fi
Harald Hoyer 53e990
-
Harald Hoyer 53e990
-        # If the source is symlink we operate on its target.
Harald Hoyer 53e990
-        [[ ${_realsrc} ]] && _src=${_realsrc}
Harald Hoyer 53e990
-        inst ${_src}
Harald Hoyer 53e990
+        inst_simple ${_src}
Harald Hoyer 53e990
         # Decompress with chosen tool.  We assume that tool changes name e.g.
Harald Hoyer 53e990
         # from 'name.gz' to 'name'.
Harald Hoyer 53e990
         ${_cmd} "${initdir}${_src}"