=================================================================== RCS file: /cvs/openbsd/fill_chroot/fix_ldconfig,v retrieving revision 1.4 retrieving revision 1.9 diff -u -r1.4 -r1.9 --- openbsd/fill_chroot/fix_ldconfig 2006/06/29 19:44:19 1.4 +++ openbsd/fill_chroot/fix_ldconfig 2008/09/30 22:55:57 1.9 @@ -1,17 +1,23 @@ #!/bin/sh -# $RedRiver: fix_ldconfig,v 1.3 2005/12/21 19:14:12 andrew Exp $ +# $RedRiver: fix_ldconfig,v 1.8 2008/09/16 22:44:51 andrew Exp $ -CHROOT=${CHROOT:=/var/www} - -if [ ${CHROOT}"X" == "X" ]; then +if [ X"${CHROOT}" == X"" ]; then echo No CHROOT Specified! exit 255 fi -mkdir -p ${CHROOT}/bin mkdir -p ${CHROOT}/var/run -cp /sbin/ldconfig ${CHROOT}/bin -chroot ${CHROOT} /bin/ldconfig /usr/lib /usr/X11R6/lib /usr/local/lib -#chroot ${CHROOT} /bin/ldconfig -r -rm -f ${CHROOT}/bin/ldconfig +for p in `ldconfig -r | awk '/search directories:/ { gsub(":", " ", $3); print $3 }'` ; do + if [ -d ${CHROOT}${p} ]; then + LD_PATH="${LD_PATH} ${p}" + fi +done + +if [ ! X"${LD_PATH}" == X"" ]; then + cp /sbin/ldconfig ${CHROOT} + echo running: ldconfig ${LD_PATH} + chroot ${CHROOT} ldconfig ${LD_PATH} + #chroot ${CHROOT} ldconfig -r + rm -f ${CHROOT}/ldconfig +fi