summaryrefslogtreecommitdiff
path: root/mk/bsd.pkg.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-03-22 04:07:15 +0000
committerjlam <jlam@pkgsrc.org>2004-03-22 04:07:15 +0000
commit2e83c332f16a691e135eaa1a9a43ef9b97728f6e (patch)
tree54e3148de06acbd891b9a7ca26cd434738f8b80c /mk/bsd.pkg.mk
parent1ec44d55ec625dc575219c7e1e00288d16996500 (diff)
downloadpkgsrc-2e83c332f16a691e135eaa1a9a43ef9b97728f6e.tar.gz
Due to the special handling of pkgtools/digest in pkgsrc (it must be
installed before the normal dependency checks), on a system without any packages installed, we can run into the problem where digest won't install because it has already been installed as part of installing a build dependency. This can happen if, e.g., PKGSRC_COMPILER is set to "ccache gcc", and you try to build devel/gmake. Change the way that the uptodate-digest target installs pkgtools/digest by ensuring that pkgtools/digest is deinstalled just before installing it.
Diffstat (limited to 'mk/bsd.pkg.mk')
-rw-r--r--mk/bsd.pkg.mk29
1 files changed, 18 insertions, 11 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 32d20f7f9ca..ce68c3d0499 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1425 2004/03/19 00:03:55 danw Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1426 2004/03/22 04:07:15 jlam Exp $
#
# This file is in the public domain.
#
@@ -763,6 +763,17 @@ MESSAGE_SUBST+= PKGNAME=${PKGNAME} \
MESSAGE_SUBST_SED= ${MESSAGE_SUBST:S/=/}!/:S/$/!g/:S/^/ -e s!\\\${/}
.endif
+# If pkgsrc is supposed to ensure that tests are run before installation
+# of the package, then the build targets should be "build test", otherwise
+# just "build" suffices. _PKGSRC_BUILD_TARGETS is used in the "all",
+# "install", and "uptodate-digest" targets.
+#
+.if !empty(PKGSRC_RUN_TEST:M[yY][eE][sS])
+_PKGSRC_BUILD_TARGETS= build test
+.else
+_PKGSRC_BUILD_TARGETS= build
+.endif
+
# Latest version of digest(1) required for pkgsrc
DIGEST_REQD= 20010302
@@ -778,6 +789,10 @@ uptodate-digest:
if [ -f ${DIGEST} ]; then \
${MAKE} ${MAKEFLAGS} deinstall; \
fi; \
+ ${MAKE} ${MAKEFLAGS} ${_PKGSRC_BUILD_TARGETS}; \
+ if [ -f ${DIGEST} ]; then \
+ ${MAKE} ${MAKEFLAGS} deinstall; \
+ fi; \
${MAKE} ${MAKEFLAGS} ${DEPENDS_TARGET}; \
${MAKE} ${MAKEFLAGS} clean; } \
fi
@@ -1520,11 +1535,7 @@ BUILD_DEFS+= OSVERSION_SPECIFIC
.PHONY: all
.if !target(all)
-. if ${PKGSRC_RUN_TEST} == "YES" || ${PKGSRC_RUN_TEST} == "yes"
-all: test
-. else
-all: build
-. endif
+all: ${_PKGSRC_BUILD_TARGETS}
.endif
.if !defined(DEPENDS_TARGET)
@@ -3190,11 +3201,7 @@ test: build ${TEST_COOKIE}
.PHONY: install
.if !target(install)
-. if ${PKGSRC_RUN_TEST} == "YES" || ${PKGSRC_RUN_TEST} == "yes"
-install: uptodate-pkgtools build test ${INSTALL_COOKIE}
-. else
-install: uptodate-pkgtools build ${INSTALL_COOKIE}
-. endif
+install: uptodate-pkgtools ${_PKGSRC_BUILD_TARGETS} ${INSTALL_COOKIE}
.endif
.PHONY: package