From: Peter Hjalmarsson Date: Sun, 3 Mar 2013 21:11:26 +0000 (+0100) Subject: Unify copy_binaries() more X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4733b318169415c111d029183c2bc181744b7858;p=genkernel.git Unify copy_binaries() more As suggested by Vapier in bug #450688. Signed-off-by: Peter Hjalmarsson --- diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 3ae9d7a..af6dff6 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -34,21 +34,18 @@ copy_binaries() { done # This must be OUTSIDE the for loop, we only want to run lddtree etc ONCE. # lddtree does not have the -V (version) nor the -l (list) options prior to version 1.18 + ( if lddtree -V > /dev/null 2>&1 ; then - lddtree -l "$@" \ - | sort \ - | uniq \ - | cpio -p --make-directories --dereference --quiet "${destdir}" \ - || gen_die "Binary ${f} or some of its library dependencies could not be copied" + lddtree -l "$@" else lddtree "$@" \ | tr ')(' '\n' \ - | awk '/=>/{ if($3 ~ /^\//){print $3}}' \ + | awk '/=>/{ if($3 ~ /^\//){print $3}}' + fi ) \ | sort \ | uniq \ | cpio -p --make-directories --dereference --quiet "${destdir}" \ || gen_die "Binary ${f} or some of its library dependencies could not be copied" - fi } log_future_cpio_content() {