summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjoerg <joerg>2009-02-06 15:27:00 +0000
committerjoerg <joerg>2009-02-06 15:27:00 +0000
commit2894fb7c15eafdd9fe1da28d8e9596e390c7326b (patch)
tree999b381dd6cf1f0a53b928ef466ff64a2e1e7b28 /mk
parent328b32f0033cea1805d7cbbd687a2bd2c0686c70 (diff)
downloadpkgsrc-2894fb7c15eafdd9fe1da28d8e9596e390c7326b.tar.gz
Fix circular dependency detection for the case of non-leading circles.
For the dependency chain A->B->B the old code created: _PKGSRC_DEPS=", B-1.0, A-1.0", which obviously can't match the PKGNAME of B. Skip the _flavor-bootstrap-depends processing if PKG_FAIL_REASON is already set and move the check for circular dependencies right after the block that defines PKGNAME and friends.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.mk12
-rw-r--r--mk/flavor/pkg/depends.mk13
2 files changed, 15 insertions, 10 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 798240f7c77..536323f4ee9 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1952 2008/09/22 14:52:07 dillo Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1953 2009/02/06 15:27:00 joerg Exp $
#
# This file is in the public domain.
#
@@ -46,6 +46,11 @@ PKGNAME_NOREV= ${PKGNAME}
.endif
PKGVERSION_NOREV= ${PKGNAME_NOREV:C/^.*-//}
+# Fail-safe in the case of circular dependencies
+.if defined(_PKGSRC_DEPS) && defined(PKGNAME) && !empty(_PKGSRC_DEPS:M${PKGNAME})
+PKG_FAIL_REASON+= "Circular dependency detected"
+.endif
+
####
############################################################################
@@ -120,11 +125,6 @@ _INSTALL_UNSTRIPPED= # set (flag used by platform/*.mk)
# Sanity checks
############################################################################
-# Fail-safe in the case of circular dependencies
-.if defined(_PKGSRC_DEPS) && defined(PKGNAME) && !empty(_PKGSRC_DEPS:M${PKGNAME})
-PKG_FAIL_REASON+= "Circular dependency detected"
-.endif
-
# PKG_INSTALLATION_TYPE can only be one of two values: "pkgviews" or
# "overwrite".
.if (${PKG_INSTALLATION_TYPE} != "pkgviews") && \
diff --git a/mk/flavor/pkg/depends.mk b/mk/flavor/pkg/depends.mk
index eaaaf28f0eb..a0bf998f33a 100644
--- a/mk/flavor/pkg/depends.mk
+++ b/mk/flavor/pkg/depends.mk
@@ -1,4 +1,4 @@
-# $NetBSD: depends.mk,v 1.43 2008/05/26 14:21:43 tron Exp $
+# $NetBSD: depends.mk,v 1.44 2009/02/06 15:27:00 joerg Exp $
# This command prints out the dependency patterns for all full (run-time)
# dependencies of the package.
@@ -79,7 +79,7 @@ _DEPENDS_INSTALL_CMD= \
${STEP_MSG} "Verifying $$target for $$dir"; \
[ -d "$$dir" ] || ${FAIL_MSG} "[depends.mk] The directory \`\`$$dir'' does not exist."; \
cd $$dir; \
- ${SETENV} ${PKGSRC_MAKE_ENV} _PKGSRC_DEPS=", ${PKGNAME}${_PKGSRC_DEPS}" PKGNAME_REQD="$$pattern" ${MAKE} ${MAKEFLAGS} _AUTOMATIC=yes $$target; \
+ ${SETENV} ${PKGSRC_MAKE_ENV} _PKGSRC_DEPS="${PKGNAME} ${_PKGSRC_DEPS}" PKGNAME_REQD="$$pattern" ${MAKE} ${MAKEFLAGS} _AUTOMATIC=yes $$target; \
pkg=`${_PKG_BEST_EXISTS} "$$pattern" || ${TRUE}`; \
case "$$pkg" in \
"") ${ERROR_MSG} "[depends.mk] A package matching \`\`$$pattern'' should"; \
@@ -142,10 +142,10 @@ pkg_install-depends:
${RUN}if [ `${PKG_INFO_CMD} -V 2>/dev/null || echo 20010302` -lt ${PKGTOOLS_REQD} ]; then \
${PHASE_MSG} "Trying to handle out-dated pkg_install..."; \
cd ../../pkgtools/pkg_install && ${SETENV} ${PKGSRC_MAKE_ENV} \
- _PKGSRC_DEPS=", ${PKGNAME}${_PKGSRC_DEPS}" \
+ _PKGSRC_DEPS="${PKGNAME} ${_PKGSRC_DEPS}" \
${MAKE} ${MAKEFLAGS} _AUTOMATIC=yes clean && \
cd ../../pkgtools/pkg_install && ${SETENV} ${PKGSRC_MAKE_ENV} \
- _PKGSRC_DEPS=", ${PKGNAME}${_PKGSRC_DEPS}" \
+ _PKGSRC_DEPS="${PKGNAME} ${_PKGSRC_DEPS}" \
${MAKE} ${MAKEFLAGS} _AUTOMATIC=yes ${DEPENDS_TARGET:Q}; \
fi
@@ -164,12 +164,17 @@ _BOOTSTRAP_DEPENDS_TARGETS+= release-bootstrap-depends-lock
bootstrap-depends: ${_BOOTSTRAP_DEPENDS_TARGETS}
.PHONY: _flavor-bootstrap-depends
+.if empty(PKG_FAIL_REASON)
_flavor-bootstrap-depends:
${RUN}${_LIST_DEPENDS_CMD.bootstrap} | \
while read type pattern dir; do \
${TEST} "$$type" = "bootstrap" || continue; \
${_DEPENDS_INSTALL_CMD}; \
done
+.else
+_flavor-bootstrap-depends:
+ ${RUN}${DO_NADA}
+.endif
.PHONY:
acquire-bootstrap-depends-lock: acquire-lock