From owner-p4-projects@FreeBSD.ORG Tue Jul 18 16:01:51 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F0C0B16A512; Tue, 18 Jul 2006 16:01:50 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 86A6616A50C for ; Tue, 18 Jul 2006 16:01:50 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CDD4A43D5A for ; Tue, 18 Jul 2006 16:01:45 +0000 (GMT) (envelope-from gabor@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k6IG1jKb070215 for ; Tue, 18 Jul 2006 16:01:45 GMT (envelope-from gabor@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6IG1j6V070212 for perforce@freebsd.org; Tue, 18 Jul 2006 16:01:45 GMT (envelope-from gabor@FreeBSD.org) Date: Tue, 18 Jul 2006 16:01:45 GMT Message-Id: <200607181601.k6IG1j6V070212@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gabor@FreeBSD.org using -f From: Gabor Kovesdan To: Perforce Change Reviews Cc: Subject: PERFORCE change 101855 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2006 16:01:51 -0000 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)