Date: Mon, 17 Jul 2006 11:20:10 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 101750 for review Message-ID: <200607171120.k6HBKAA4076483@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=101750 Change 101750 by gabor@gabor_spitfire on 2006/07/17 11:19:49 Chroot pkg_info when checking if the port is already installed. Affected files ... .. //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#28 edit Differences ... ==== //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#28 (text+ko) ==== @@ -3708,10 +3708,10 @@ .if !target(check-already-installed) check-already-installed: .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER) - @${ECHO_MSG} "===> Checking if ${PKGORIGIN} already installed" - @${MKDIR} ${PKG_DBDIR} .if !defined(DESTDIR) - @already_installed=`${PKG_INFO} -q -O ${PKGORIGIN}`; \ + @${ECHO_MSG} "===> Checking if ${PKGORIGIN} already installed"; \ + ${MKDIR} ${PKG_DBDIR}; \ + already_installed=`${PKG_INFO} -q -O ${PKGORIGIN}`; \ if [ -n "$${already_installed}" ]; then \ for p in $${already_installed}; do \ prfx=`${PKG_INFO} -q -p $${p} 2> /dev/null | ${SED} -ne '1s|^@cwd ||p'`; \ @@ -3723,7 +3723,23 @@ fi; \ fi; \ done; \ - fi; + fi +.else + @${ECHO_MSG} "===> Checking if ${PKGORIGIN} already installed in ${DESTDIR}"; \ + ${MKDIR} ${PKG_DBDIR}; \ + already_installed=`${CHROOT} ${DESTDIR} ${PKG_INFO} -q -O ${PKGORIGIN}`; \ + if [ -n "$${already_installed}" ]; then \ + for p in $${already_installed}; do \ + prfx=`${PKG_INFO} -q -p $${p} 2> /dev/null | ${SED} -ne '1s|^@cwd ||p'`; \ + if [ "x${PREFIX}" = "x$${prfx}" ]; then \ + df=`${CHROOT} ${DESTDIR} ${PKG_INFO} -q -f $${p} 2> /dev/null | ${GREP} -v "^@" | ${COMM} -12 - ${TMPPLIST}`; \ + if [ -n "$${df}" ]; then \ + found_package=$${p}; \ + break; \ + fi; \ + fi; \ + done; \ + fi .endif @if [ -d ${PKG_DBDIR}/${PKGNAME} -o -n "$${found_package}" ]; then \ if [ -d ${PKG_DBDIR}/${PKGNAME} ]; then \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607171120.k6HBKAA4076483>