Blame 0097-dracut-functions-inst_script-call-inst_binary-with-f.patch
|
Harald Hoyer |
401ad9 |
From f60995adb4b5498a2b1dda112e3cd6fab57c9ba1 Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
401ad9 |
From: Harald Hoyer <harald@redhat.com>
|
|
Harald Hoyer |
401ad9 |
Date: Fri, 21 Oct 2011 12:33:05 +0200
|
|
Harald Hoyer |
401ad9 |
Subject: [PATCH] dracut-functions:inst_script() call inst_binary() with found
|
|
Harald Hoyer |
401ad9 |
bin
|
|
Harald Hoyer |
401ad9 |
|
|
Harald Hoyer |
401ad9 |
call inst_binary() with the already found executable to prevent
|
|
Harald Hoyer |
401ad9 |
searching for the binary again
|
|
Harald Hoyer |
401ad9 |
---
|
|
Harald Hoyer |
401ad9 |
dracut-functions | 3 ++-
|
|
Harald Hoyer |
401ad9 |
1 files changed, 2 insertions(+), 1 deletions(-)
|
|
Harald Hoyer |
401ad9 |
|
|
Harald Hoyer |
401ad9 |
diff --git a/dracut-functions b/dracut-functions
|
|
Harald Hoyer |
401ad9 |
index a56e460..a5d6d1f 100755
|
|
Harald Hoyer |
401ad9 |
--- a/dracut-functions
|
|
Harald Hoyer |
401ad9 |
+++ b/dracut-functions
|
|
Harald Hoyer |
401ad9 |
@@ -443,13 +443,14 @@ inst_binary() {
|
|
Harald Hoyer |
401ad9 |
inst_script() {
|
|
Harald Hoyer |
401ad9 |
local _bin
|
|
Harald Hoyer |
401ad9 |
_bin=$(find_binary "$1") || return 1
|
|
Harald Hoyer |
401ad9 |
+ shift
|
|
Harald Hoyer |
401ad9 |
local _line _shebang_regex
|
|
Harald Hoyer |
401ad9 |
read -r -n 80 _line <"$_bin"
|
|
Harald Hoyer |
401ad9 |
# If debug is set, clean unprintable chars to prevent messing up the term
|
|
Harald Hoyer |
401ad9 |
[[ $debug ]] && _line=$(echo -n "$_line" | tr -c -d '[:print:][:space:]')
|
|
Harald Hoyer |
401ad9 |
_shebang_regex='(#! *)(/[^ ]+).*'
|
|
Harald Hoyer |
401ad9 |
[[ $_line =~ $_shebang_regex ]] || return 1
|
|
Harald Hoyer |
401ad9 |
- inst "${BASH_REMATCH[2]}" && inst_binary "$@"
|
|
Harald Hoyer |
401ad9 |
+ inst "${BASH_REMATCH[2]}" && inst_binary "$_bin" "$@"
|
|
Harald Hoyer |
401ad9 |
}
|
|
Harald Hoyer |
401ad9 |
|
|
Harald Hoyer |
401ad9 |
# same as above, but specialized for symlinks
|