From owner-p4-projects@FreeBSD.ORG Sun Jul 9 17:20:06 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 5742216A4DF; Sun, 9 Jul 2006 17:20:06 +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 2734416A4DD for ; Sun, 9 Jul 2006 17:20:06 +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 B406043D4C for ; Sun, 9 Jul 2006 17:20:05 +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 k69HK5wH037515 for ; Sun, 9 Jul 2006 17:20:05 GMT (envelope-from gabor@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k69HK5W6037512 for perforce@freebsd.org; Sun, 9 Jul 2006 17:20:05 GMT (envelope-from gabor@FreeBSD.org) Date: Sun, 9 Jul 2006 17:20:05 GMT Message-Id: <200607091720.k69HK5W6037512@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 101137 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: Sun, 09 Jul 2006 17:20:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=101137 Change 101137 by gabor@gabor_spitfire on 2006/07/09 17:19:34 Implement conflict checking in DESTDIR. This method uses chroot to do that, I also made a ${CHROOT} variable for that. The current TODO list: - Implement deinstall from DESTDIR (it will happen with chroot as well) - Add some clarification when printing file lists at the end of the installation process - Fix dependency handling for DESTDIR, I realized that this is still broken when I tested the current change Affected files ... .. //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#13 edit Differences ... ==== //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#13 (text+ko) ==== @@ -1032,6 +1032,7 @@ CHGRP?= /usr/bin/chgrp CHMOD?= /bin/chmod CHOWN?= /usr/sbin/chown +CHROOT?= /usr/sbin/chroot COMM?= /usr/bin/comm CP?= /bin/cp CPIO?= /usr/bin/cpio @@ -3518,11 +3519,10 @@ # Check conflicts -### FIXME: conflict checking in DESTDIR is temporarly ignored for testing - .if !target(check-conflicts) check-conflicts: -.if defined(CONFLICTS) && !defined(DISABLE_CONFLICTS) && !defined(DESTDIR) +.if defined(CONFLICTS) && !defined(DISABLE_CONFLICTS) +.if !defined(DESTDIR) @found=`${PKG_INFO} -I ${CONFLICTS:C/.+/'&'/} 2>/dev/null | ${AWK} '{print $$1}'`; \ conflicts_with=; \ for entry in $${found}; do \ @@ -3545,6 +3545,30 @@ ${ECHO_MSG} " Please remove them first with pkg_delete(1)."; \ exit 1; \ fi +.else + @found=`${CHROOT} ${DESTDIR} ${PKG_INFO} -I ${CONFLICTS:C/.+/'&'/} 2>/dev/null | ${AWK} '{print $$1}'`; \ + conflicts_with=; \ + for entry in $${found}; do \ + if ${CHROOT} ${DESTDIR} ${PKG_INFO} -e $${entry} ; then \ + prfx=`${CHROOT} ${DESTDIR} ${PKG_INFO} -q -p "$${entry}" 2> /dev/null | ${SED} -ne '1s/^@cwd //p'`; \ + orgn=`${CHROOT} ${DESTDIR} ${PKG_INFO} -q -o "$${entry}" 2> /dev/null`; \ + if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \ + conflicts_with="$${conflicts_with} $${entry}"; \ + fi; \ + fi; \ + done; \ + if [ -n "$${conflicts_with}" ]; then \ + ${ECHO_MSG}; \ + ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \ + for entry in $${conflicts_with}; do \ + ${ECHO_MSG} " $${entry}"; \ + done; \ + ${ECHO_MSG}; \ + ${ECHO_MSG} " They install files into the same place."; \ + ${ECHO_MSG} " Please remove them first with pkg_delete(1)."; \ + exit 1; \ + fi +.endif .endif # CONFLICTS .endif