pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Sanity check that the package is actually installed...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ac90322f9bf1
branches:  trunk
changeset: 460198:ac90322f9bf1
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Sun Aug 24 08:51:11 2003 +0000

description:
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.

diffstat:

 mk/bsd.pkg.mk |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r fb373e6836bd -r ac90322f9bf1 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Sun Aug 24 05:02:23 2003 +0000
+++ b/mk/bsd.pkg.mk     Sun Aug 24 08:51:11 2003 +0000
@@ -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 @@
 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                                  \



Home | Main Index | Thread Index | Old Index