lddtree call must be outside the for loop.
authorRobin H. Johnson <robbat2@gentoo.org>
Wed, 18 Apr 2012 02:45:05 +0000 (19:45 -0700)
committerRobin H. Johnson <robbat2@gentoo.org>
Wed, 18 Apr 2012 02:45:05 +0000 (19:45 -0700)
ChangeLog
gen_initramfs.sh

index 6ed045ade50991381d1d23c01f0955fe928d6a0b..761a724f2ef4964414894207a0676de94b89040f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@
 # Distributed under the GPL v2
 # $Id$
 
+  18 Apr 2012; Robin H. Johnson <robbat2@gentoo.org> gen_initramfs.sh:
+  lddtree call must be outside the for loop.
+
   16 Apr 2012; Robin H. Johnson <robbat2@gentoo.org> gen_initramfs.sh:
   Use CC0 instead of public domain for copy_binaries to cover French
   jurisdiction concerns.
index 7db1c9505b6c10e0afcc6c9876fae28475b61c98..3739fe6f737a22b5c3dc19a4a0e161f2428cfd80 100755 (executable)
@@ -31,15 +31,15 @@ copy_binaries() {
                if LC_ALL=C lddtree "${binary}" 2>&1 | fgrep -q 'not found'; then
                        gen_die "Binary ${binary} is linked to missing libraries and may need to be re-built"
                fi
-
-               lddtree "${binary}" \
-                               | tr ')(' '\n' \
-                               | awk  '/=>/{ if($3 ~ /^\//){print $3}}' \
-                               | sort \
-                               | uniq \
-                               | cpio -p --make-directories --dereference --quiet "${destdir}" \
-                               || gen_die "Binary ${f} or some of its library dependencies could not be copied"
        done
+       # This must be OUTSIDE the for loop, we only want to run lddtree etc ONCE.
+       lddtree "$@" \
+                       | tr ')(' '\n' \
+                       | awk  '/=>/{ if($3 ~ /^\//){print $3}}' \
+                       | sort \
+                       | uniq \
+                       | cpio -p --make-directories --dereference --quiet "${destdir}" \
+                       || gen_die "Binary ${f} or some of its library dependencies could not be copied"
 }
 
 append_base_layout() {