Unify copy_binaries() more
authorPeter Hjalmarsson <xake@rymdraket.net>
Sun, 3 Mar 2013 21:11:26 +0000 (22:11 +0100)
committerPeter Hjalmarsson <xake@rymdraket.net>
Sun, 3 Mar 2013 21:29:15 +0000 (22:29 +0100)
As suggested by Vapier in bug #450688.

Signed-off-by: Peter Hjalmarsson <xake@rymdraket.net>
gen_initramfs.sh

index 3ae9d7a9e5962dd65ada3df454c46acfa10e60cd..af6dff6ef59262ca3f629e55fbff6b3f4e6766ae 100755 (executable)
@@ -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() {