Only run ldconfig if available in BUILD_ROOT
authorDaniel Gollub <gollub@b1-systems.de>
Mon, 23 Apr 2012 13:50:21 +0000 (15:50 +0200)
committerAdrian Schröter <adrian@suse.de>
Mon, 21 May 2012 12:50:31 +0000 (14:50 +0200)
ldconfig might not be available in a minimal crossbuild sysroot

init_buildsystem

index defc0e9..50a9087 100755 (executable)
@@ -1148,20 +1148,22 @@ for FILE in /var/run/utmp /var/log/wtmp /etc/fstab ; do
 done
 
 echo now finalizing build dir...
-CHROOT_RETURN="`chroot $BUILD_ROOT /sbin/ldconfig 2>&1`"
-case "$CHROOT_RETURN" in
-    *warning:*)
-      chroot $BUILD_ROOT /sbin/ldconfig
-      echo
-      echo chroot $BUILD_ROOT /sbin/ldconfig
-      echo
-      echo "$CHROOT_RETURN"
-      echo
-      echo "Problem with ldconfig.  It's better to reinit the build system..."
-      echo
-      cleanup_and_exit 1
-    ;;
-esac
+if test -x $BUILD_ROOT/sbin/ldconfig ; then
+       CHROOT_RETURN="`chroot $BUILD_ROOT /sbin/ldconfig 2>&1`"
+       case "$CHROOT_RETURN" in
+           *warning:*)
+             chroot $BUILD_ROOT /sbin/ldconfig
+             echo
+             echo chroot $BUILD_ROOT /sbin/ldconfig
+             echo
+             echo "$CHROOT_RETURN"
+             echo
+             echo "Problem with ldconfig.  It's better to reinit the build system..."
+             echo
+             cleanup_and_exit 1
+           ;;
+       esac
+fi
 test -x $BUILD_ROOT/usr/sbin/Check && chroot $BUILD_ROOT /usr/sbin/Check
 
 mkdir -p $BUILD_ROOT/var/adm/packages