pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/flavor/pkg Instead of the overly verbose "Required ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f05ada1f7194
branches:  trunk
changeset: 533546:f05ada1f7194
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Fri Sep 21 07:27:41 2007 +0000

description:
Instead of the overly verbose "Required installed package", the type of
dependency (bootstrap, build, full) is printed.

When building a package that pulls in the basic tools as dependencies,
it is good to know whether these are build or full dependencies, so the
additional information is useful.

diffstat:

 mk/flavor/pkg/depends.mk |  23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diffs (51 lines):

diff -r 68f1b0d9d386 -r f05ada1f7194 mk/flavor/pkg/depends.mk
--- a/mk/flavor/pkg/depends.mk  Fri Sep 21 05:26:10 2007 +0000
+++ b/mk/flavor/pkg/depends.mk  Fri Sep 21 07:27:41 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: depends.mk,v 1.38 2007/06/15 10:39:08 rillig Exp $
+# $NetBSD: depends.mk,v 1.39 2007/09/21 07:27:41 rillig Exp $
 
 # This command prints out the dependency patterns for all full (run-time)
 # dependencies of the package.
@@ -60,21 +60,24 @@
                        " "${BUILD_DEPENDS:Q} \
                        " "${DEPENDS:Q}
 
-# _DEPENDS_INSTALL_CMD expects "$pattern" to hold the dependency pattern
-#      and "$dir" to hold the package directory path associated with
-#      that dependency pattern.
+# _DEPENDS_INSTALL_CMD checks whether the package $pattern is installed,
+#      and installs it if necessary.
+#
+#      @param $pattern The pattern of the package to be installed.
+#      @param $dir The pkgsrc directory from which the package can be
+#              built.
+#      @param $type The dependency type. Can be one of bootstrap,
+#              build, full.
 #
 _DEPENDS_INSTALL_CMD=                                                  \
        pkg=`${_PKG_BEST_EXISTS} "$$pattern" || ${TRUE}`;               \
+       case $$type in bootstrap) Type=Bootstrap;; build) Type=Build;; full) Type=Full;; esac; \
        case "$$pkg" in                                                 \
        "")                                                             \
-               ${STEP_MSG} "Required installed package $$pattern: NOT found"; \
+               ${STEP_MSG} "$$Type dependency $$pattern: NOT found";   \
                target=${DEPENDS_TARGET:Q};                             \
                ${STEP_MSG} "Verifying $$target for $$dir";             \
-               if ${TEST} ! -d "$$dir"; then                           \
-                       ${ERROR_MSG} "[depends.mk] The directory \`\`$$dir'' does not exist."; \
-                       exit 1;                                         \
-               fi;                                                     \
+               [ -d "$$dir" ] || ${FAIL_MSG} "[depends.mk] The directory \`\`$$dir'' does not exist."; \
                cd $$dir;                                               \
                ${SETENV} ${PKGSRC_MAKE_ENV} _PKGSRC_DEPS=", ${PKGNAME}${_PKGSRC_DEPS}" PKGNAME_REQD="$$pattern" ${MAKE} ${MAKEFLAGS} _AUTOMATIC=yes $$target; \
                pkg=`${_PKG_BEST_EXISTS} "$$pattern" || ${TRUE}`;       \
@@ -99,7 +102,7 @@
                esac;                                                   \
                silent=${_BOOTSTRAP_VERBOSE:Dyes};                      \
                if ${TEST} -z "$${silent}"; then                        \
-                       ${STEP_MSG} "Required installed package $$pattern: $$pkg found"; \
+                       ${STEP_MSG} "$$Type dependency $$pattern: $$pkg found"; \
                fi;                                                     \
                ;;                                                      \
        esac



Home | Main Index | Thread Index | Old Index