]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-functions: fixed doubled $initdir prefix inst_library()
authorAmadeusz Żołnowski <aidecoe@aidecoe.name>
Fri, 25 Feb 2011 08:59:34 +0000 (09:59 +0100)
committerHarald Hoyer <harald@redhat.com>
Fri, 25 Feb 2011 09:06:35 +0000 (10:06 +0100)
Commit 172d85b9c949b321771d63dbd5f06ecf19cf94f0 caused following error:

./dracut-functions: line 307: cd: /tmp/initramfs.mP7cPY/tmp/initramfs.mP7cPY/lib64: No such file or directory

Patch removes beginning $initdir for symlink case.

dracut-functions

index 1cb43e756938f9573be8763db9d9eacc4f29a696..cc16760e7a16d6d2e10cf0a26b1081915c61ab17 100755 (executable)
@@ -302,8 +302,10 @@ inst_library() {
         lib=${src##*/}
         inst_simple "$reallib" "$reallib"
         inst_dir "${dest%/*}"
-        [[ -L ${initdir}${dest%/*} ]] && \
-        dest=$(readlink -f ${initdir}${dest%/*})/
+        if [[ -L ${initdir}${dest%/*} ]]; then
+            dest=$(readlink -f ${initdir}${dest%/*})/
+            dest=${dest#${initdir}}
+        fi
         (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib")
     else
         inst_simple "$src" "$dest"