From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 18 01:06:09 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F16E16A400; Wed, 18 Jul 2007 01:06:09 +0000 (UTC) (envelope-from stephen@math.missouri.edu) Received: from cauchy.math.missouri.edu (cauchy.math.missouri.edu [128.206.184.213]) by mx1.freebsd.org (Postfix) with ESMTP id E5B0913C4C8; Wed, 18 Jul 2007 01:06:03 +0000 (UTC) (envelope-from stephen@math.missouri.edu) Received: from laptop2.gateway.2wire.net (cauchy.math.missouri.edu [128.206.184.213]) by cauchy.math.missouri.edu (8.14.1/8.13.4) with ESMTP id l6I0kCgG090382; Tue, 17 Jul 2007 19:46:12 -0500 (CDT) (envelope-from stephen@math.missouri.edu) Message-ID: <469D62D3.70908@math.missouri.edu> Date: Tue, 17 Jul 2007 19:46:11 -0500 From: Stephen Montgomery-Smith User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.4) Gecko/20070717 SeaMonkey/1.1.2 MIME-Version: 1.0 To: ports@freebsd.org, freebsd-hackers@freebsd.org Content-Type: multipart/mixed; boundary="------------010700020604010509030004" Cc: Subject: Slight problem with make actual-package-depends with ports X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2007 01:06:09 -0000 This is a multi-part message in MIME format. --------------010700020604010509030004 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I appreciate that most people won't have this problem, but it has bitten me. After you have made and installed a port, but don't clean it, and then made a bunch of other ports, if you go back to the original port and then do "make package", then +CONTENTS can be a bit messed up for the package. This is because the creation of other ports might disturb _LIB_RUN_DEPENDS and might put in some extra entries in +CONTENTS. This happens to me because I make all my ports on one machine and then copy them as packages to other machines. Then on the other machines, the structure of /var/db/pkg gets a bit messed up and pkg_delete -r malfunctions. It seems to me that the cure is to slightly change "make actual-package-depends" so that if the port is already installed, it just uses +CONTENTS. I enclose a patch. Unless I get a bunch of negative comments, I'll submit this as a PR as well. Stephen --------------010700020604010509030004 Content-Type: text/plain; name="ddd" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ddd" --- bsd.port.mk-old 2007-07-17 19:31:08.000000000 -0500 +++ bsd.port.mk 2007-07-17 19:29:16.000000000 -0500 @@ -5485,7 +5485,9 @@ done ACTUAL-PACKAGE-DEPENDS?= \ - if [ "${_LIB_RUN_DEPENDS}" != " " ]; then \ + if [ -e ${PKG_DBDIR}/${PKGNAME}/+CONTENTS ]; then \ + ${AWK} -F '( |:)' 'BEGIN { pkgname="broken_contents" } /@pkgdep / { pkgname=$$2 } /@comment DEPORIGIN:/ { printf "%s:%s\n", pkgname, $$3; pkgname="broken_contents" }' ${PKG_DBDIR}/${PKGNAME}/+CONTENTS; \ + elif [ "${_LIB_RUN_DEPENDS}" != " " ]; then \ origins=$$(for pkgname in ${PKG_DBDIR}/*; do \ if [ -e $$pkgname/+CONTENTS ]; then \ ${ECHO_CMD} $${pkgname\#\#*/}; \ --------------010700020604010509030004--