Date: Tue, 18 Jul 2006 16:01:45 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 101855 for review Message-ID: <200607181601.k6IG1j6V070212@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=101855 Change 101855 by gabor@gabor_spitfire on 2006/07/18 16:01:05 Avoid code duplication when looking for dependencies. Affected files ... .. //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#38 edit Differences ... ==== //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#38 (text+ko) ==== @@ -4844,7 +4844,6 @@ lib-depends: .if defined(LIB_DEPENDS) && !defined(NO_DEPENDS) -.if !defined(DESTDIR) @for i in ${LIB_DEPENDS}; do \ lib=$${i%%:*}; \ case $$lib in \ @@ -4860,60 +4859,34 @@ else \ dir=$${dir%%:*}; \ fi; \ - ${ECHO_MSG} -n "===> ${PKGNAME} depends on shared library: $$lib"; \ - if ${LDCONFIG} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \ - ${ECHO_MSG} " - found"; \ - if [ ${_DEPEND_ALWAYS} = 1 ]; then \ - ${ECHO_MSG} " (but building it anyway)"; \ + if [ -z "${DESTDIR}" ] ; then \ + ${ECHO_MSG} -n "===> ${PKGNAME} depends on shared library: $$lib"; \ + if ${LDCONFIG} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \ + ${ECHO_MSG} " - found"; \ + if [ ${_DEPEND_ALWAYS} = 1 ]; then \ + ${ECHO_MSG} " (but building it anyway)"; \ + notfound=1; \ + else \ + notfound=0; \ + fi; \ + else \ + ${ECHO_MSG} " - not found"; \ notfound=1; \ - else \ - notfound=0; \ fi; \ else \ - ${ECHO_MSG} " - not found"; \ - notfound=1; \ - fi; \ - if [ $$notfound != 0 ]; then \ - ${ECHO_MSG} "===> Verifying $$target for $$lib in $$dir"; \ - if [ ! -d "$$dir" ]; then \ - ${ECHO_MSG} " => No directory for $$lib. Skipping.."; \ + ${ECHO_MSG} -n "===> ${PKGNAME} depends on shared library in ${DESTDIR}: $$lib"; \ + if ${CHROOT} ${DESTDIR} ${LDCONFIG} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \ + ${ECHO_MSG} " - found"; \ + if [ ${_DEPEND_ALWAYS} = 1 ]; then \ + ${ECHO_MSG} " (but building it anyway)"; \ + notfound=1; \ + else \ + notfound=0; \ + fi; \ else \ - ${_INSTALL_DEPENDS} \ - if ! ${LDCONFIG} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \ - ${ECHO_MSG} "Error: shared library \"$$lib\" does not exist"; \ - ${FALSE}; \ - fi; \ - fi; \ - fi; \ - done -.else - @for i in ${LIB_DEPENDS}; do \ - lib=$${i%%:*}; \ - case $$lib in \ - *.*.*) pattern="`${ECHO_CMD} $$lib | ${SED} -e 's/\./\\\\./g'`" ;;\ - *.*) pattern="$${lib%%.*}\.$${lib#*.}" ;;\ - *) pattern="$$lib" ;;\ - esac; \ - dir=$${i#*:}; \ - target=$${i##*:}; \ - if ${TEST} $$dir = $$target; then \ - target="${DEPENDS_TARGET}"; \ - depends_args="${DEPENDS_ARGS}"; \ - else \ - dir=$${dir%%:*}; \ - fi; \ - ${ECHO_MSG} -n "===> ${PKGNAME} depends on shared library: $$lib in ${DESTDIR}"; \ - if ${CHROOT} ${DESTDIR} ${LDCONFIG} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \ - ${ECHO_MSG} " - found"; \ - if [ ${_DEPEND_ALWAYS} = 1 ]; then \ - ${ECHO_MSG} " (but building it anyway)"; \ + ${ECHO_MSG} " - not found"; \ notfound=1; \ - else \ - notfound=0; \ fi; \ - else \ - ${ECHO_MSG} " - not found"; \ - notfound=1; \ fi; \ if [ $$notfound != 0 ]; then \ ${ECHO_MSG} "===> Verifying $$target for $$lib in $$dir"; \ @@ -4921,7 +4894,7 @@ ${ECHO_MSG} " => No directory for $$lib. Skipping.."; \ else \ ${_INSTALL_DEPENDS} \ - if ! ${CHROOT} ${DESTDIR} ${LDCONFIG} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \ + if ! ${LDCONFIG} -r | ${GREP} -vwF -e "${PKGCOMPATDIR}" | ${GREP} -qwE -e "-l$$pattern"; then \ ${ECHO_MSG} "Error: shared library \"$$lib\" does not exist"; \ ${FALSE}; \ fi; \ @@ -4929,7 +4902,6 @@ fi; \ done .endif -.endif misc-depends: .if defined(DEPENDS)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607181601.k6IG1j6V070212>