pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/flavor/pkg Partly backout the commit and move insta...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fe92816ca987
branches:  trunk
changeset: 529132:fe92816ca987
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Fri May 25 19:07:23 2007 +0000

description:
Partly backout the commit and move install-dependencies back into
depends.mk. The quoting of arrays passed down is almost impossible
to get right. For example, PKG_BUILD_OPTION.* variables can contain
multiple space separated entries but have to be quoted twice.

The original commit exposed two separate issues:
- too many variables are passed down via MAKEFLAGS, including the above
mentioned PKG_BUILD_OPTIONs.
- x11/gtk2 used an invalid variable name that can't be assigned
correctly via make command line.

This is supposed to fix PR 36387.

diffstat:

 mk/flavor/pkg/depends.mk           |  63 ++++++++++++++++++++++++----
 mk/flavor/pkg/install-dependencies |  83 --------------------------------------
 2 files changed, 54 insertions(+), 92 deletions(-)

diffs (178 lines):

diff -r cfba2b4bf1ce -r fe92816ca987 mk/flavor/pkg/depends.mk
--- a/mk/flavor/pkg/depends.mk  Fri May 25 18:57:27 2007 +0000
+++ b/mk/flavor/pkg/depends.mk  Fri May 25 19:07:23 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: depends.mk,v 1.31 2007/05/23 00:23:24 joerg Exp $
+# $NetBSD: depends.mk,v 1.32 2007/05/25 19:07:23 joerg Exp $
 
 # This command prints out the dependency patterns for all full (run-time)
 # dependencies of the package.
@@ -54,12 +54,49 @@
                        " "${BUILD_DEPENDS:Q} \
                        " "${DEPENDS:Q}
 
-_INSTALL_DEPENDS=      ${PKGSRCDIR}/mk/flavor/pkg/install-dependencies
-.for _var in _PKG_DBDIR _PKGSR_DEPS _DEPENDS_FILE DEPENDS_TARGET \
-       MAKE MAKEFLAGS OBJECT_FMT PKG_ADMIN PKG_INFO PKGNAME \
-       PKGSRC_MAKE_ENV SETENV
-_INSTALL_DEPENDS_ARGS+=        ${_var}=${${_var}:Q:Q}
-.endfor
+# _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=                                                  \
+       pkg=`${_PKG_BEST_EXISTS} "$$pattern" || ${TRUE}`;               \
+       case "$$pkg" in                                                 \
+       "")                                                             \
+               ${STEP_MSG} "Required installed package $$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;                                                     \
+               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}`;       \
+               case "$$pkg" in                                         \
+               "")     ${ERROR_MSG} "[depends.mk] A package matching \`\`$$pattern'' should"; \
+                       ${ERROR_MSG} "    be installed, but one cannot be found.  Perhaps there is a"; \
+                       ${ERROR_MSG} "    stale work directory for $$dir?"; \
+                       exit 1;                                         \
+               esac;                                                   \
+               ${STEP_MSG} "Returning to build of ${PKGNAME}";         \
+               ;;                                                      \
+       *)                                                              \
+               objfmt=`${PKG_INFO} -Q OBJECT_FMT "$$pkg"`;             \
+               case "$$objfmt" in                                      \
+               "")     ${WARNING_MSG} "[depends.mk] Unknown object format for installed package $$pkg" ;; \
+               ${OBJECT_FMT})  ;;                                      \
+               *)      ${ERROR_MSG} "[depends.mk] Installed package $$pkg has an"; \
+                       ${ERROR_MSG} "    object format \`\`$$objfmt'' which differs from \`\`${OBJECT_FMT}''.  Please"; \
+                       ${ERROR_MSG} "    update the $$pkg package to ${OBJECT_FMT}."; \
+                       exit 1;                                         \
+                       ;;                                              \
+               esac;                                                   \
+               if ${TEST} -z "$$silent"; then                          \
+                       ${STEP_MSG} "Required installed package $$pattern: $$pkg found"; \
+               fi;                                                     \
+               ;;                                                      \
+       esac;                                                           \
+       done
 
 ${_DEPENDS_FILE}:
        ${RUN} ${MKDIR} ${.TARGET:H}
@@ -72,7 +109,11 @@
 #      Installs any missing dependencies.
 #
 _flavor-install-dependencies: .PHONY ${_DEPENDS_FILE}
-       ${RUN}${SH} ${_INSTALL_DEPENDS} no-bootstrap ${_INSTALL_DEPENDS_ARGS}
+       ${RUN}${CAT} ${_DEPENDS_FILE} |                                 \
+       while read type pattern dir; do                                 \
+               ${TEST} "$$type" = "bootstrap" && continue;             \
+               ${_DEPENDS_INSTALL_CMD};                                \
+       done
 
 # _flavor-post-install-dependencies:
 #      Targets after installing all dependencies.
@@ -92,7 +133,11 @@
 _BOOTSTRAP_DEPENDS_TARGETS+=   release-bootstrap-depends-lock
 
 bootstrap-depends: ${_BOOTSTRAP_DEPENDS_TARGETS}
-       ${RUN}${SH} ${_INSTALL_DEPENDS} bootstrap ${_INSTALL_DEPENDS_ARGS}
+       ${RUN}${CAT} ${_DEPENDS_FILE} |                                 \
+       while read type pattern dir; do                                 \
+               ${TEST} "$$type" != "bootstrap" && continue;            \
+               ${_DEPENDS_INSTALL_CMD};                                \
+       done
 
 .PHONY: 
 acquire-bootstrap-depends-lock: acquire-lock
diff -r cfba2b4bf1ce -r fe92816ca987 mk/flavor/pkg/install-dependencies
--- a/mk/flavor/pkg/install-dependencies        Fri May 25 18:57:27 2007 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-#!/bin/sh
-#
-######################################################################
-#
-# NAME
-#      install-dependencies -- install package dependencies
-#
-# SYNOPSIS
-#      register-dependencies [ filter ]
-#
-# DESCRIPTION
-#      install-dependencies checks all entries in ${DEPENDS_FILE}
-#      for existance. Missing entries get installed by
-#      ${DEPENDS_TARGET} in the listed directory.
-#
-######################################################################
-
-: ${CAT:=cat}
-: ${ECHO:=echo}
-: ${TEST:=test}
-: ${TRUE:=true}
-
-set -e
-
-bootstrap_mode="$1"
-shift
-
-eval "$@"
-
-error_msg() {
-       ${ECHO} "ERROR:" "$*" 1>&2
-}
-
-step_msg() {
-       ${ECHO} "=>" "$*"
-}
-
-find_best() {
-       ${PKG_ADMIN} -b -d ${_PKG_DBDIR} -S lsbest $1 || ${TRUE}
-}
-
-${CAT} ${_DEPENDS_FILE} | while read type pattern dir; do
-       if $TEST "$bootstrap_mode" = "bootstrap"; then
-               $TEST "$type" != "bootstrap" && continue
-       else
-               $TEST "$type" = "bootstrap" && continue
-       fi
-       pkg=`find_best "$pattern"`
-       case "$pkg" in
-       "")
-               step_msg "Required installed package $pattern: NOT found"
-               target=${DEPENDS_TARGET}
-               if ${TEST} ! -d "$dir"; then
-                       error_msg "[install-depends] The directory \`\`$dir'' does not exist."
-                       exit 1
-               fi
-               step_msg "Verifying $target for $dir"
-               cd $dir
-               ${SETENV} ${PKGSRC_MAKE_ENV} _PKGSRC_DEPS=", ${PKGNAME}${_PKGSRC_DEPS}" PKGNAME_REQD="$pattern" ${MAKE} ${MAKEFLAGS} _AUTOMATIC=yes $target
-               pkg=`find_best "$pattern"`
-               case "$pkg" in
-               "")     error_msg "[install-depends] A package matching \`\`$pattern'' should"
-                       error_msg "    be installed, but one cannot be found.  Perhaps there is a"
-                       error_msg "    stale work directory for $dir?"
-                       exit 1
-               esac
-               step_msg "Returning to build of ${PKGNAME}"
-               ;;
-       *)
-               objfmt=`${PKG_INFO} -Q OBJECT_FMT "$pkg"`
-               case "$objfmt" in
-               "")     ${WARNING_MSG} "[install-depends] Unknown object format for installed package $pkg" ;;
-               ${OBJECT_FMT})  ;;
-               *)      error_msg "[install-depends] Installed package $pkg has an"
-                       error_msg "    object format \`\`$objfmt'' which differs from \`\`${OBJECT_FMT}''.  Please"
-                       error_msg "    update the $pkg package to ${OBJECT_FMT}."
-                       exit 1
-                       ;;
-               esac;
-               step_msg "Required installed package $pattern: $pkg found"
-               ;;
-       esac
-done



Home | Main Index | Thread Index | Old Index