From c555693f91ebda6ec75b2551e25a4920752c2208 Mon Sep 17 00:00:00 2001 From: tokiclover Date: Sun, 2 Nov 2014 13:35:28 +0100 Subject: [PATCH] mkinitramfs-ll.{ba,z}sh: minor binary adding fix --- mkinitramfs-ll.bash | 3 +-- mkinitramfs-ll.zsh | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mkinitramfs-ll.bash b/mkinitramfs-ll.bash index 29fae23..18c9965 100755 --- a/mkinitramfs-ll.bash +++ b/mkinitramfs-ll.bash @@ -535,8 +535,7 @@ for bin in ${opts[-b]//:/ } ${opts[-bin]//:/ }; do [[ -x ${b} ]] && continue 2 done - [[ -x ${bin} ]] && dobin ${bin} - binary=$(type -p ${bin}) + [[ -x ${bin} ]] && binary=${bin} || binary=$(type -p ${bin}) [[ "${binary}" ]] && dobin ${binary} || warn "no ${bin} binary found" binary= done diff --git a/mkinitramfs-ll.zsh b/mkinitramfs-ll.zsh index 3751d3c..0ce3684 100755 --- a/mkinitramfs-ll.zsh +++ b/mkinitramfs-ll.zsh @@ -497,10 +497,11 @@ function dobin { for bin (${(pws,:,)opts[-b]} ${(pws,:,)opts[-bin]}) { for b ({usr/,}{,s}bin/${bin}) { [[ -x ${b} ]] && continue 2 } - [[ -x ${bin} ]] && dobin ${bin} - (( ${+commands[$bin]} )) && dobin ${commands[$bin]} || - warn "no ${bin} binary found" + [[ -x ${bin} ]] && binary=${bin} || binary=${commands[$bin]} + [[ -n ${binary} ]] && dobin ${binary} || warn "no ${bin} binary found" + binary= } +unset -v binary # Remove module group name from boot group before processing module groups for mod (${(pws,:,)opts[-mboot]})