From owner-freebsd-ports@FreeBSD.ORG Tue Nov 15 17:53:54 2005 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3707516A41F for ; Tue, 15 Nov 2005 17:53:54 +0000 (GMT) (envelope-from ringworm01@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9DE143D45 for ; Tue, 15 Nov 2005 17:53:53 +0000 (GMT) (envelope-from ringworm01@gmail.com) Received: by zproxy.gmail.com with SMTP id 9so1026257nzo for ; Tue, 15 Nov 2005 09:53:52 -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=iM30o8ucBdVWHDVU/0uZ90FAl/df0vLL/VhRw+WxbUOKL/l9sP1vZ470KXozJTwQB65x2gNJ6T0H8GLpYVUd1K2E7KqVcmwGeAfigUL3lOLxMPax9gHPRoTu3/hMO48RccM3E51/AMgVTqORaVf/jSmeQmOClXMNvBghWpeskx0= Received: by 10.36.132.11 with SMTP id f11mr5327527nzd; Tue, 15 Nov 2005 09:53:52 -0800 (PST) Received: from ?192.168.1.10? ( [71.102.14.129]) by mx.gmail.com with ESMTP id 20sm501804nzp.2005.11.15.09.53.49; Tue, 15 Nov 2005 09:53:52 -0800 (PST) From: "Michael C. Shultz" To: Craig Boston Date: Tue, 15 Nov 2005 09:44:25 -0800 User-Agent: KMail/1.8.3 References: <200511142259.45090.ringworm01@gmail.com> <20051115143721.GA36868@nowhere> In-Reply-To: <20051115143721.GA36868@nowhere> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511150944.26278.ringworm01@gmail.com> Cc: Jiawei Ye , freebsd-ports@freebsd.org Subject: Re: Why does security/amavisd-new depend on db3? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2005 17:53:54 -0000 On Tuesday 15 November 2005 06:37, Craig Boston wrote: > On Mon, Nov 14, 2005 at 10:59:44PM -0800, Michael C. Shultz wrote: > > The WITH_BDB_VER=42 only needs to be applied to databases/p5-BerkeleyDB, > > In theory, yes, however for dependencies to be registered properly it is > needed for the top level port as well. > > Look at line 5012 of bsd.port.mk, where it populates the +CONTENTS file. > PKG_ARGS is defined on line 2052 and issues a "make package-depends" > command, which recursively gown down the ports tree building a list of > dependencies. However, as previously demonstrated, that list is based on > the _current_ environment of the package that is being installed at that > moment. > > > when "portmanager security/amavisd-new" is run ports will build in this > > order: > > > > ports/databases/db42 before > > databases/p5-BerkeleyDB before > > security/amavisd-new > > The behavior can easily be reproduced with manual builds by doing them > in that same order: > > cd /usr/ports/databases/p5-BerkeleyDB; make install WITH_BDB_VER=42 > cd /usr/ports/security/amavisd-new; make install > > The second command will install amavisd-new with an erroneous pkgdep on > bdb3. > > Doing with second install with WITH_BDB_VER=42 set will cause it to be > correct. The first install is unnecessary in this case, but portmanager > would install it separately like that. > > ISTM the only way to work around it would be for portmanager to keep > track of which ports were built with what flags, and add those same > flags to any port that depends on them... > > Craig Hmm, I just checked /var/db/pkg/amavisd-new-2.3.3,1/+CONTENTS and you are correct, there really is a databases/db3 in there! @pkgdep db3-3.3.11_2,1 @comment DEPORIGIN:databases/db3 but if you do this: cd /usr/ports/security/amavisd-new make -V RUN_DEPENDS -V LIB_DEPENDS {No WITH_BDB_VER=42 switch} /usr/local/lib/perl5/site_perl/5.8.7/mach/Unix/Syslog.pm:/usr/ports/sysutils/p5-Unix-Syslog /usr/local/lib/perl5/site_perl/5.8.7/MIME/Words.pm:/usr/ports/mail/p5-MIME-Tools /usr/local/lib/perl5/site_perl/5.8.7/Convert/TNEF.pm:/usr/ports/converters/p5-Convert-TNEF /usr/local/lib/perl5/site_perl/5.8.7/mach/Convert/UUlib.pm:/usr/ports/converters/p5-Convert-UUlib /usr/local/lib/perl5/site_perl/5.8.7/mach/Compress/Zlib.pm:/usr/ports/archivers/p5-Compress-Zlib /usr/local/lib/perl5/site_perl/5.8.7/Archive/Tar.pm:/usr/ports/archivers/p5-Archive-Tar /usr/local/lib/perl5/site_perl/5.8.7/Archive/Zip.pm:/usr/ports/archivers/p5-Archive-Zip /usr/local/lib/perl5/site_perl/5.8.7/Net/Server.pm:/usr/ports/net/p5-Net-Server /usr/local/lib/perl5/site_perl/5.8.7/Mail/SpamAssassin.pm:/usr/ports/mail/p5-Mail-SpamAssassin /usr/local/lib/perl5/site_perl/5.8.7/mach/BerkeleyDB.pm:/usr/ports/databases/p5-BerkeleyDB /usr/local/bin/arc:/usr/ports/archivers/arc /usr/local/bin/unfreeze:/usr/ports/archivers/freeze /usr/local/bin/lha:/usr/ports/archivers/lha /usr/local/bin/lzop:/usr/ports/archivers/lzop /usr/local/bin/unarj:/usr/ports/archivers/unarj /usr/local/bin/unrar:/usr/ports/archivers/unrar /usr/local/bin/zoo:/usr/ports/archivers/zoo /usr/local/bin/cabextract:/usr/ports/archivers/cabextract /usr/local/bin/rpm2cpio.pl:/usr/ports/archivers/rpm2cpio /usr/local/lib/perl5/site_perl/5.8.7/mach/Mysql.pm:/usr/ports/databases/p5-DBD-mysql /usr/local/lib/perl5/site_perl/5.8.7/mach/DBD/Pg.pm:/usr/ports/databases/p5-DBD-Pg /usr/local/lib/perl5/site_perl/5.8.7/Net/LDAP.pm:/usr/ports/net/p5-perl-ldap /usr/local/bin/perl5.8.7:/usr/ports/lang/perl5.8 The db dependencies stop at /usr/local/lib/perl5/site_perl/5.8.7/mach/BerkeleyDB.pm:/usr/ports/databases/p5-BerkeleyDB which is correct according to /usr/ports/security/amavisd-new/Makefile who for db only lists: ${SITE_PERL}/${PERL_ARCH}/BerkeleyDB.pm:${PORTSDIR}/databases/p5-BerkeleyDB Anyways, the extra, unnessesary and INCORRECT entries in +CONTENTS would indeed have caused portmanager problems a short while ago. Portmanager used to only use the +CONTENTS file to determine dependencies and in this case that would definitely cause trouble. Beginning with ver 0.3.1 Portmanager started also collecting dependencies using make -V *_DEPENDS and so now has two dependency databases: ports_dependencies.db which come from +CONTENTS and ports_available_dependencies.db which come from make -V *_DEPENDS The idea is that ports_available_dependencies.db overrides ports_dependencies.db, but this has been tricky in practice. I released version 0.3.5 a little earlier than intended because in an unrelated report there was a case where portmanager got the priority wrong between these two data bases and that was fixed in 0.3.5. You pointed out very clearly that my understanding of +CONTENTS was flawed, because I allways believed it recorded the dependencies used to build after the fact, which it clearly doesn't. Bottom line is portmanager 0.3.5 should be able to build security/amavisd-new as intended and by my own tests it does. My understanding of the bsd.ports.mk language is poor, but 5027 - 5034 look suspicious. Probably no one cares but I can't think of a single good reason to transvers dependent port's dependencies when adding dependencies to +CONTENTS. The fact they do should no longer cause portmanager troubles but if Jiawei is to be believed it looks like portupgrade might be being negatively effected by these unnessesary and incorrect entries.. -Mike