dracut/0097-dracut-functions-inst_script-call-inst_binary-with-f.patch

33 lines
1.1 KiB
Diff
Raw Normal View History

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