summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-06-01 17:56:08 +0200
committerAaron Griffin <aaron@archlinux.org>2006-06-01 17:56:08 +0200
commit902bf52141dcdb862176eb7e629453ca00e2dcbe (patch)
treecf70444bda3f4151616a7b0aac64e0d4228c02cb /functions
parente75dd3b57c247e650277f26f4f1b5ade3bd0f620 (diff)
downloadmkinitcpio-902bf52141dcdb862176eb7e629453ca00e2dcbe.tar.gz
mkinitcpio-902bf52141dcdb862176eb7e629453ca00e2dcbe.tar.xz
Fix for add_bin function, without destination param
git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@118 880c04e9-e011-0410-abf7-b926e227c9cd
Diffstat (limited to 'functions')
-rw-r--r--functions11
1 files changed, 8 insertions, 3 deletions
diff --git a/functions b/functions
index 715b555..c9a85ad 100644
--- a/functions
+++ b/functions
@@ -139,12 +139,17 @@ _finish_modules ()
add_binary ()
{
- local bin type lib
+ local bin dest type lib
bin=$(which "${1}")
if [ $? -ne 0 ]; then
bin="${1}"
fi
+ dest=""
+ if [ $# -eq 2 ]; then
+ dest=$2
+ fi
+
if [ ! -f "${bin}" ]; then
err "'${bin}' is not a file"
return 1
@@ -155,10 +160,10 @@ add_binary ()
case "${type}" in
*script*)
msg " adding '${type}' script, ensure proper interp exists..."
- add_file "${bin}" "${2}"
+ add_file "${bin}" ${dest}
;;
*executable*)
- add_file "${bin}" "${2}"
+ add_file "${bin}" ${dest}
#note, this will also handle 'not a dynamic executable' spit out by
# static binaries... the deps will produce nothing
for lib in $(ldd ${bin} 2>/dev/null | sed "s|.*=>\(.*\)|\1|"); do