summaryrefslogtreecommitdiff
path: root/mk/flavor
diff options
context:
space:
mode:
authorjoerg <joerg>2008-04-03 14:07:51 +0000
committerjoerg <joerg>2008-04-03 14:07:51 +0000
commit0811c1121273052a9b875ec0a56d8ed869a5ef4d (patch)
tree68a4e35995a7f58f576b5e1e1b589becdf4ab2c0 /mk/flavor
parent760bac77cb86c831505f9808c6ed1c8b0bee8824 (diff)
downloadpkgsrc-0811c1121273052a9b875ec0a56d8ed869a5ef4d.tar.gz
Move handling of pkg_install version into flavor. Add an explicit
phase pkg_install-depends before bootstrap-depends that just tries to install a new pkg_install if the current version is too old. Still keep it as bootstrap dependency for the bulk build code. For NetBSD, PKG_TOOLS_BIN has to be computed in shell code due to a make bug. OK: jlam@
Diffstat (limited to 'mk/flavor')
-rw-r--r--mk/flavor/pkg/depends.mk20
-rw-r--r--mk/flavor/pkg/flavor-vars.mk11
2 files changed, 29 insertions, 2 deletions
diff --git a/mk/flavor/pkg/depends.mk b/mk/flavor/pkg/depends.mk
index c4eeff00626..c02c7e5f76a 100644
--- a/mk/flavor/pkg/depends.mk
+++ b/mk/flavor/pkg/depends.mk
@@ -1,4 +1,4 @@
-# $NetBSD: depends.mk,v 1.41 2008/03/10 20:05:59 joerg Exp $
+# $NetBSD: depends.mk,v 1.42 2008/04/03 14:07:51 joerg Exp $
# This command prints out the dependency patterns for all full (run-time)
# dependencies of the package.
@@ -132,6 +132,24 @@ _flavor-install-dependencies: .PHONY ${_DEPENDS_FILE}
_flavor-post-install-dependencies: .PHONY ${_RDEPENDS_FILE}
######################################################################
+### pkg_install-depends (PUBLIC, pkgsrc/mk/depends/depends.mk)
+######################################################################
+### pkg_install-depends is a public target to install or update
+### pkg_install itself.
+###
+.PHONY: pkg_install-depends
+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}" \
+ ${MAKE} ${MAKEFLAGS} _AUTOMATIC=yes clean && \
+ cd ../../pkgtools/pkg_install && ${SETENV} ${PKGSRC_MAKE_ENV} \
+ _PKGSRC_DEPS=", ${PKGNAME}${_PKGSRC_DEPS}" \
+ ${MAKE} ${MAKEFLAGS} _AUTOMATIC=yes ${DEPENDS_TARGET:Q}; \
+ fi
+
+######################################################################
### bootstrap-depends (PUBLIC, pkgsrc/mk/depends/depends.mk)
######################################################################
### bootstrap-depends is a public target to install any missing
diff --git a/mk/flavor/pkg/flavor-vars.mk b/mk/flavor/pkg/flavor-vars.mk
index 7443e0c17fe..ca6b063e660 100644
--- a/mk/flavor/pkg/flavor-vars.mk
+++ b/mk/flavor/pkg/flavor-vars.mk
@@ -1,4 +1,4 @@
-# $NetBSD: flavor-vars.mk,v 1.7 2008/03/10 20:05:59 joerg Exp $
+# $NetBSD: flavor-vars.mk,v 1.8 2008/04/03 14:07:51 joerg Exp $
#
# This Makefile fragment is included indirectly by bsd.prefs.mk and
# defines some variables which must be defined earlier than where
@@ -35,11 +35,20 @@ PKG_INFO_CMD?= ${PKG_TOOLS_BIN}/pkg_info
PKG_VIEW_CMD?= ${PKG_TOOLS_BIN}/pkg_view
LINKFARM_CMD?= ${PKG_TOOLS_BIN}/linkfarm
+# Latest versions of tools required for correct pkgsrc operation.
+PKGTOOLS_REQD= 20070813
+
.if !defined(PKGTOOLS_VERSION)
PKGTOOLS_VERSION!= ${PKG_INFO_CMD} -V 2>/dev/null || echo 20010302
MAKEFLAGS+= PKGTOOLS_VERSION=${PKGTOOLS_VERSION}
.endif
+# Check that we are using up-to-date pkg_* tools with this file.
+.if !defined(NO_PKGTOOLS_REQD_CHECK) && ${PKGTOOLS_VERSION} < ${PKGTOOLS_REQD}
+BOOTSTRAP_DEPENDS+= pkg_install>=${PKGTOOLS_REQD}:../../pkgtools/pkg_install
+_PKG_INSTALL_DEPENDS= yes
+.endif
+
# audit-packages logic for its location depends on a variety of factors
# including OS, pkg_install version and NetBSD version. The following
# should pick the correct version to run.