From owner-cvs-all Mon Sep 16 16:49:13 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 05BD737B400; Mon, 16 Sep 2002 16:49:11 -0700 (PDT) Received: from shale.csir.co.za (shale.csir.co.za [146.64.46.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id B5F8B43E3B; Mon, 16 Sep 2002 16:49:05 -0700 (PDT) (envelope-from reg@shale.csir.co.za) Received: (from reg@localhost) by shale.csir.co.za (8.11.6/8.11.6) id g8GNl5v45228; Tue, 17 Sep 2002 01:47:05 +0200 (SAT) (envelope-from reg) Date: Tue, 17 Sep 2002 01:47:05 +0200 From: Jeremy Lea To: Kris Kennaway Cc: Maxim Sobolev , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: ports/security/openssl Makefile ports/archivers/bzip2 Makefile ports/archivers/unzip Makefile ports/devel/gmake Makefile ports/devel/automake Makefile ports/devel/automake14 Makefile ports/devel/autoconf213 Makefile ports/devel/libtool Makefile ... Message-ID: <20020916234705.GC30691@shale.csir.co.za> Mail-Followup-To: Jeremy Lea , Kris Kennaway , Maxim Sobolev , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org References: <200209141332.g8EDW7Yl048862@freefall.freebsd.org> <20020915125857.GA30691@shale.csir.co.za> <20020915174805.GA15732@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020915174805.GA15732@xor.obsecurity.org> User-Agent: Mutt/1.4i Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, On Sun, Sep 15, 2002 at 10:48:05AM -0700, Kris Kennaway wrote: > I like this idea..I've been bitten by circular dependencies in the > ports tree before. Can you develop it into a patch I can test on the > bento cluster? Attached. I've reused PARENT_CHECKED from (ALL|PACKAGE)-DEPENDS-LIST, because this also stops these recursing, although it doesn't give an error. They way that they work is not very condusive to error messages... This doesn't catch the case where you are depending on a port which is already installed (e.g. if you have X installed, X11.6 is found, and so x11/XFree86-4-libraries still builds with USE_XLIB (without Maxim's patch). This still doesn't result in a fork bomb, but might on package registration. I didn't test this case. The pkg_* tools should protect themselves against recursive depends in any case... Feel free to edit/play. Regards, -Jeremy -- FreeBSD - Because the best things in life are free... http://www.freebsd.org/ Index: bsd.port.mk =================================================================== RCS file: /usr/home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.423 diff -u -r1.423 bsd.port.mk --- bsd.port.mk 13 Sep 2002 18:47:30 -0000 1.423 +++ bsd.port.mk 16 Sep 2002 23:27:37 -0000 @@ -674,6 +674,18 @@ PKGNAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}${_SUF1}${_SUF2} DISTNAME?= ${PORTNAME}-${PORTVERSION} +# Recurive dependency check... +PARENT_CHECKED?= "" +.if ${PARENT_CHECKED:S/${MASTERDIR}//}!=${PARENT_CHECKED} +pre-everything:: + @${ECHO_CMD} "Dependency list results in a recursive build of ${PKGNAME}." + @${ECHO_CMD} "If you're defining any USE_* variables on the command line or" + @${ECHO_CMD} "in /etc/make.conf, then you're probably doing something wrong..." + @${FALSE} +.else +PARENT_CHECKED+= ${MASTERDIR} +.endif + # These need to be absolute since we don't know how deep in the ports # tree we are and thus can't go relative. They can, of course, be overridden # by individual Makefiles or local system make configuration. @@ -2986,7 +2998,7 @@ if [ ! -d "$$dir" ]; then \ ${ECHO_MSG} " >> No directory for $$prog. Skipping.."; \ else \ - (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args) ; \ + (cd $$dir; ${MAKE} PARENT_CHECKED="${PARENT_CHECKED}" -DINSTALLS_DEPENDS $$target $$depends_args) ; \ ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \ fi; \ fi; \ @@ -3027,7 +3039,7 @@ if [ ! -d "$$dir" ]; then \ ${ECHO_MSG} " >> No directory for $$lib. Skipping.."; \ else \ - (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args) ; \ + (cd $$dir; ${MAKE} PARENT_CHECKED="${PARENT_CHECKED}" -DINSTALLS_DEPENDS $$target $$depends_args) ; \ ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \ if ${LDCONFIG} -r | ${GREP} -qwF -e "-l$$lib"; then \ ${TRUE}; \ @@ -3059,7 +3071,7 @@ if [ ! -d $$dir ]; then \ ${ECHO_MSG} " >> No directory for $$dir. Skipping.."; \ else \ - (cd $$dir; ${MAKE} $$target $$depends_args) ; \ + (cd $$dir; ${MAKE} PARENT_CHECKED="${PARENT_CHECKED}" $$target $$depends_args) ; \ fi \ done @${ECHO_MSG} "===> Returning to build of ${PKGNAME}" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message