From 904b7b580feb8db32743dacb7002d8f9e060bb83 Mon Sep 17 00:00:00 2001 From: espie Date: Tue, 12 Jul 2011 10:04:00 +0000 Subject: [PATCH] for depends, always run checks on fullpkgname vs pkgspec upfront. exit if the dependency doesn't match. then do the actual dependency and the normal tests. stop looking at full pkgnames list, makes no sense, even configure depends can use the required ,-subpackage if they want. This allows stuff such as BUILD_DEPENDS = dir>=5.0:configure to get out early if the tree is not uptodate, instead of first configuring then getting out (problem noticed by landry@). tested by landry@ and jasper@ --- infrastructure/mk/bsd.port.mk | 38 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/infrastructure/mk/bsd.port.mk b/infrastructure/mk/bsd.port.mk index 2c675a5e35b..f02e986f7c5 100644 --- a/infrastructure/mk/bsd.port.mk +++ b/infrastructure/mk/bsd.port.mk @@ -1,6 +1,6 @@ #-*- mode: Makefile; tab-width: 4; -*- # ex:ts=4 sw=4 filetype=make: -# $OpenBSD: bsd.port.mk,v 1.1098 2011/07/12 08:08:01 ajacoutot Exp $ +# $OpenBSD: bsd.port.mk,v 1.1099 2011/07/12 10:04:00 espie Exp $ # $FreeBSD: bsd.port.mk,v 1.264 1996/12/25 02:27:44 imp Exp $ # $NetBSD: bsd.port.mk,v 1.62 1998/04/09 12:47:02 hubertf Exp $ # @@ -1647,12 +1647,12 @@ _parse_spec = \ esac; unset IFS; ${_flavor_fragment} _compute_default = \ - if ! default=`eval $$toset ${MAKE} _print-packagename`; then \ + if ! default=`eval $$toset exec ${MAKE} _print-packagename`; then \ echo 1>&2 "Problem with dependency ${_i}"; \ exit 1; \ fi -_set_pkg2default= pkg=`eval $$toset ${MAKE} _print-pkgspec` +_set_pkg2default= pkg=`eval $$toset exec ${MAKE} _print-pkgspec` _set_stem2default=stem=`echo $$default|${_version2stem}`; \ pkg="$$stem$${pkg\#STEM}" @@ -1912,20 +1912,26 @@ ${WRKDIR}/.dep-${_i:C,>=,ge-,g:C,<=,le-,g:C,<,lt-,g:C,>,gt-,g:C,\*,ANY,g:C,[|:/= exit 1;; \ esac; \ toset="$$toset _SOLVING_DEP=Yes"; \ + ${_compute_default}; \ case "X$$pkg" in \ X) \ - if ! pkg=`eval $$toset ${MAKE} _print-pkgspec`; \ + if ! ${_set_pkg2default}; \ then \ ${ECHO_MSG} "===> Error in evaluating dependency ${_i}"; \ ${REPORT_PROBLEM}; \ exit 1; \ fi;; \ XSTEM*) \ - if default=`eval $$toset ${MAKE} _print-packagename`; \ - then \ - ${_set_stem2default}; \ - fi;; \ + ${_set_stem2default};; \ esac; \ + what=$$pkg; \ + if ! ${PKG_INFO} ${PKGDB_LOCK} -q -r "$$pkg" $$default; \ + then \ + : $${msg:= $$default does not match}; \ + ${ECHO_MSG} "===> ${FULLPKGNAME${SUBPACKAGE}}${_MASTER} depends on: $$what -$$msg"; \ + ${REPORT_PROBLEM}; \ + exit 1; \ + fi; \ for abort in false false true; do \ if $$abort; then \ ${ECHO_MSG} "Dependency check failed"; \ @@ -1933,7 +1939,6 @@ ${WRKDIR}/.dep-${_i:C,>=,ge-,g:C,<=,le-,g:C,<,lt-,g:C,>,gt-,g:C,\*,ANY,g:C,[|:/= exit 1; \ fi; \ found=false; \ - what=$$pkg; \ if $$checkinstall; then \ $$early_exit || ${_force_update_fragment}; \ if ${_PKG_QUERY} "$$pkg" -q; then \ @@ -1953,16 +1958,7 @@ ${WRKDIR}/.dep-${_i:C,>=,ge-,g:C,<=,le-,g:C,<,lt-,g:C,>,gt-,g:C,\*,ANY,g:C,[|:/= exit 1; \ fi; \ if $$early_exit; then \ - list=`eval $$toset exec ${MAKE} show=PKGNAMES`; \ - if ${PKG_INFO} ${PKGDB_LOCK} -q -r "$$pkg" $$list; \ - then \ - break; \ - else \ - : $${msg:= not found}; \ - ${ECHO_MSG} "===> ${FULLPKGNAME${SUBPACKAGE}}${_MASTER} depends on: $$what -$$msg"; \ - ${REPORT_PROBLEM}; \ - exit 1; \ - fi; \ + break; \ fi; \ done; \ } @@ -2066,7 +2062,9 @@ ${WRKINST}/.saved_libs: ${_FAKE_COOKIE} port-lib-depends-check: ${WRKINST}/.saved_libs . for _S in ${MULTI_PACKAGES} - @-SUBPACKAGE=${_S} ${MAKE} print-plist-with-depends lib_depends_args=all-lib-depends-args| \ + @-SUBPACKAGE=${_S} ${MAKE} print-plist-with-depends \ + lib_depends_args=all-lib-depends-args \ + wantlib_args=fake-wantlib-args| \ ${_CHECK_LIB_DEPENDS} -s ${WRKINST}/.saved_libs . endfor