From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Nov 17 20:06:38 2005 Return-Path: X-Original-To: freebsd-ports-bugs@freebsd.org Delivered-To: freebsd-ports-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ADB1516A41F for ; Thu, 17 Nov 2005 20:06:38 +0000 (GMT) (envelope-from ringworm01@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id B162C43D46 for ; Thu, 17 Nov 2005 20:06:28 +0000 (GMT) (envelope-from ringworm01@gmail.com) Received: by zproxy.gmail.com with SMTP id 40so12003nzk for ; Thu, 17 Nov 2005 12:06:15 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=F0h9fqF7Y5MYpIA4Dt2neIQFlyoKgJmI4hZowZ1GUnkCRp7MqN8xmCxxJvFVu/lf0y9ppOleW4uCdAH4qRNaBGJT1PppdsszP8pMw1HvHpDRw8ycSmdeghuGiJpFNARVstf5nUYVFyB2WzPM4+bsNhZ6pHRFeo8WZ45p1HnUFKk= Received: by 10.36.196.14 with SMTP id t14mr7679033nzf; Thu, 17 Nov 2005 12:06:15 -0800 (PST) Received: from ?192.168.1.10? ( [71.102.14.129]) by mx.gmail.com with ESMTP id 7sm1671612nzo.2005.11.17.12.06.04; Thu, 17 Nov 2005 12:06:15 -0800 (PST) From: "Michael C. Shultz" To: freebsd-ports-bugs@freebsd.org, vd@datamax.bg Date: Thu, 17 Nov 2005 11:56:47 -0800 User-Agent: KMail/1.8.3 References: <200511171540.jAHFeJSL017500@freefall.freebsd.org> <1132245985.79514.32.camel@localhost> <20051117193353.GA53615@qlovarnika.bg.datamax> In-Reply-To: <20051117193353.GA53615@qlovarnika.bg.datamax> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511171156.48357.ringworm01@gmail.com> Cc: Pav Lucistnik Subject: Re: ports/89164: [PATCH] /var/db/pkg/{portname}/+CONTENTS files sometimes contain wrong data X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2005 20:06:38 -0000 On Thursday 17 November 2005 11:33, Vasil Dimov wrote: > On Thu, Nov 17, 2005 at 05:46:25PM +0100, Pav Lucistnik wrote: > > Yes, there is a long standing problem and we're aware of it. Sadly, no > > workable solution was submitted so far (at least I haven't found any PR > > filed against it). > > Hmmz, what about the following: > > --- bsd.port.mk_dep.diff begins here --- > --- bsd.port.mk.orig Thu Nov 17 21:04:11 2005 > +++ bsd.port.mk.dep Thu Nov 17 21:18:21 2005 > @@ -4638,7 +4638,7 @@ > dir=$$(${REALPATH} $$dir); \ > if [ -d $$dir ]; then \ > if (${ECHO_CMD} $$checked | ${GREP} -qwv "$$dir"); then \ > - childout=$$(cd $$dir; ${MAKE} CHILD_DEPENDS=yes > PARENT_CHECKED="$$checked" package-depends-list); \ + childout=$$(cd ^^^^^^^^^^^^^^^^^^^^^^^^ I don't even pretend to understand scripting, but this line looks like a problem, if you are using "package-depends-list" as a data source it will fail the test I proposed in this PR's How To Repeat section because results can be modified with WITH_* values placed into the environment. To get the +CONTENTS file right need to gather the data like this: port being registered = cd /usr/ports/cat/port;make -V PKGNAME get first level dependencies then from cd /usr/ports/cat/port;make -V RUN_DEPENDS -V LIB_DEPENDS -V DEPENDS then each dependency returned go to it's /var/db/pkg/+CONTENTS file and gather each dependency recorded when it was installed (this works recursively) looking from bottom up at how to gather the information: depPortLevel4 -=> no dpenedencies recodfed at install time depPortLevel3 -=> make -V RUN_DEPENDS -V LIB_DEPENDS -V DEPENDS returns depPortLevel4 so depPortLevel4 goes to +CONTENTS file +CONTENTS=depPortLevel4 depPortLevel2 -=> make -V RUN_DEPENDS -V LIB_DEPENDS -V DEPENDS returns depPortLevel3 so depPortLevel3 goes to +CONTENTS file a look at depPortLevel3's +CONTENTS file reveils depPortLevel4 so +CONTENTS=depPortLevel3 +CONTENTS=depPortLevel4 depPortLevel1 -=> make -V RUN_DEPENDS -V LIB_DEPENDS -V DEPENDS returns depPortLevel2 and a look at depPortLevel2's +CONTENTS file returns depPortLevel3 and depPortLevel4 so +CONTENTS=depPortLevel2 +CONTENTS=depPortLevel3 +CONTENTS=depPortLevel4 -Mike > $$dir ; pkgnm=`${MAKE} -V PKGNAME` ; if [ -d ${PKG_DBDIR}/$$pkgnm ] ; then > for p in $$pkgnm `${PKG_INFO} -qr ${PKG_DBDIR}/$$pkgnm |${CUT} -f 2 -d ' '` > ; do porigin=`pkg_info -qo /var/db/pkg/$$p` ; ${ECHO_CMD} "$$p > ${PORTSDIR}/$$porigin $$porigin" ; done ; else ${MAKE} CHILD_DEPENDS=yes > PARENT_CHECKED="$$checked" package-depends-list; fi); \ set -- $$childout; > \ > childdir=""; \ > while [ $$\# != 0 ]; do \ > @@ -4651,7 +4651,7 @@ > else \ > ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list > incomplete" >&2; \ fi; \ > - done > + done | ${SORT} -u > > # Print out package names. > > --- bsd.port.mk_dep.diff ends here --- > > The idea is to check if the port is installed and get necessary > info with `pkg_info -r', instead of `make package-depends-list' > > Looks quite ugly, some part of the sh code can be extracted > into separate make variable or at least that 380+ bytes line can be > broken down into shorter lines.