summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2003-08-24 08:51:11 +0000
committerjlam <jlam@pkgsrc.org>2003-08-24 08:51:11 +0000
commit0d84a72afe36fae42259d0b16ecc555b545ddb1d (patch)
tree751b7fa4c3c204ca125aa6cde9918911e32f9697
parentc0ce2257b8f9d8ef0ee0c17826a9038d2445611a (diff)
downloadpkgsrc-0d84a72afe36fae42259d0b16ecc555b545ddb1d.tar.gz
Sanity check that the package is actually installed by running pkg_info(1)
before trying to create the binary package. This makes: cd pkgsrc/category/foo make install pkg_delete foo make package fail because package "foo" isn't actually installed, so no binary package can be built.
-rw-r--r--mk/bsd.pkg.mk8
1 files changed, 7 insertions, 1 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index c48900c9309..83be8cab2f7 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1244 2003/08/23 09:11:19 grant Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1245 2003/08/24 08:51:11 jlam Exp $
#
# This file is in the public domain.
#
@@ -2254,6 +2254,12 @@ do-install:
real-su-package: ${PLIST} ${DESCR}
${_PKG_SILENT}${_PKG_DEBUG} \
${ECHO_MSG} "${_PKGSRC_IN}> Building binary package for ${PKGNAME}"; \
+ if ${PKG_INFO} -qe ${PKGNAME}; then \
+ : The package is installed. ; \
+ else \
+ ${ECHO_MSG} "=> ${PKGNAME} is not installed."; \
+ exit 1; \
+ fi; \
if [ ! -d ${PKGREPOSITORY} ]; then \
${MKDIR} ${PKGREPOSITORY}; \
if [ $$? -ne 0 ]; then \