pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk Fix circular dependency detection for the case of n...
details: https://anonhg.NetBSD.org/pkgsrc/rev/2ca9317fa913
branches: trunk
changeset: 554008:2ca9317fa913
user: joerg <joerg%pkgsrc.org@localhost>
date: Fri Feb 06 15:27:00 2009 +0000
description:
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:
mk/bsd.pkg.mk | 12 ++++++------
mk/flavor/pkg/depends.mk | 13 +++++++++----
2 files changed, 15 insertions(+), 10 deletions(-)
diffs (82 lines):
diff -r ba31cefa3b06 -r 2ca9317fa913 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk Fri Feb 06 14:30:57 2009 +0000
+++ b/mk/bsd.pkg.mk Fri Feb 06 15:27:00 2009 +0000
@@ -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 @@
.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 @@
# 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 -r ba31cefa3b06 -r 2ca9317fa913 mk/flavor/pkg/depends.mk
--- a/mk/flavor/pkg/depends.mk Fri Feb 06 14:30:57 2009 +0000
+++ b/mk/flavor/pkg/depends.mk Fri Feb 06 15:27:00 2009 +0000
@@ -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 @@
${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 @@
${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: ${_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
Home |
Main Index |
Thread Index |
Old Index