summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authoragc <agc@pkgsrc.org>2001-05-22 11:43:36 +0000
committeragc <agc@pkgsrc.org>2001-05-22 11:43:36 +0000
commita6d943268f3dded3f5ca6b5ca5c71a07456f77af (patch)
tree4572e373a65541eb318ba5b29b54a6d85e3465af /mk
parent9124d4437956ec7e62489ff10fa2da1f2f3bee5b (diff)
downloadpkgsrc-a6d943268f3dded3f5ca6b5ca5c71a07456f77af.tar.gz
Save the version of the package extracted in the ${EXTRACT_COOKIE}, and
check at installation time that this version matches ${PKGNAME}. Idea by abs, implementation by hubertf, minor munging by me.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.mk12
1 files changed, 11 insertions, 1 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 864de62be83..3e1ffc7a5e0 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.744 2001/05/20 01:58:20 hubertf Exp $
+# $NetBSD: bsd.pkg.mk,v 1.745 2001/05/22 11:43:36 agc Exp $
#
# This file is in the public domain.
#
@@ -2067,6 +2067,7 @@ package: uptodate-pkgtools install ${PACKAGE_COOKIE}
${EXTRACT_COOKIE}:
${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} real-extract DEPENDS_TARGET=${DEPENDS_TARGET}
+ ${_PKG_SILENT}${_PKG_DEBUG}${ECHO} ${PKGNAME} >> ${EXTRACT_COOKIE}
${PATCH_COOKIE}:
${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} real-patch
${CONFIGURE_COOKIE}:
@@ -2097,6 +2098,15 @@ SU_CMD?= ${SU} - root -c
PRE_ROOT_CMD?= ${TRUE}
do-su-install:
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ extractname=`${CAT} ${EXTRACT_COOKIE}`; \
+ case "$$extractname" in \
+ "") ${ECHO_MSG} "*** Warning: ${WRKDIR} may contain an older version of ${PKGBASE}" ;; \
+ "${PKGNAME}") ;; \
+ *) ${ECHO_MSG} "*** Error: Package version $$extractname in ${WRKDIR}, current version ${PKGNAME} in pkgsrc directory"; \
+ ${ECHO_MSG} "*** Please rebuild the package using the newer version: \"make clean && make\""; \
+ exit 1 ;; \
+ esac
@${ECHO_MSG} "${_PKGSRC_IN}> Installing for ${PKGNAME}"
${_PKG_SILENT}${_PKG_DEBUG} \
if [ `${ID} -u` = 0 ]; then \