From owner-svn-src-user@FreeBSD.ORG Wed Dec 30 03:59:45 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7569A1065670; Wed, 30 Dec 2009 03:59:45 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64ABE8FC0C; Wed, 30 Dec 2009 03:59:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBU3xjaJ046079; Wed, 30 Dec 2009 03:59:45 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBU3xjYp046077; Wed, 30 Dec 2009 03:59:45 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912300359.nBU3xjYp046077@svn.freebsd.org> From: Doug Barton Date: Wed, 30 Dec 2009 03:59:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201245 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 03:59:45 -0000 Author: dougb Date: Wed Dec 30 03:59:45 2009 New Revision: 201245 URL: http://svn.freebsd.org/changeset/base/201245 Log: Bug fix: ======== PM_BUILD_ONLY_LIST should only be set to pm_bol in the command line parser if we are in the parent. Feature expansion: ================== Do a more thorough job of tracking things that should fall into the --packages-build/--delete-build-only category. I.e., if something is a run dependency of a port or ports that themselves are only build dependencies, add it to the build_only_dl_g anyway. New internal: ============= Add a uniquify_list function so that internal lists of variables can be made unique. Start using it for some of the new stuff, and in clean_build_only_list(). Cleanup: ======== Factor out one line of common code for the rundep list in dep_check() Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Wed Dec 30 00:03:36 2009 (r201244) +++ user/dougb/portmaster/portmaster Wed Dec 30 03:59:45 2009 (r201245) @@ -229,6 +229,12 @@ safe_exit () { if [ "$PM_BUILD_ONLY_LIST" = pmp_doing_build_deps ]; then echo "build_only_dl_g='$build_only_dl_g'" >> $IPC_SAVE echo "run_dl_g='$run_dl_g'" >> $IPC_SAVE + rundep_list=`uniquify_list $rundep_list` + echo "rundep_list='$rundep_list'" >> $IPC_SAVE + for f in $rundep_list; do + eval echo "export $f=\'\$$f\'" >> $IPC_SAVE + eval echo "export ${f}_p=\'\$${f}_p\'" >> $IPC_SAVE + done fi [ -n "$PM_DEL_BUILD_ONLY" ] && echo "build_deps_il='$build_deps_il'" >> $IPC_SAVE @@ -451,9 +457,11 @@ for var in "$@" ; do esac done -if [ -n "$PM_PACKAGES_BUILD" -o -n "$PM_DEL_BUILD_ONLY" ]; then - PM_BUILD_ONLY_LIST=pm_bol - export PM_BUILD_ONLY_LIST +if [ "$$" -eq "$PM_PARENT_PID" ]; then # XXXXX!!!!! + if [ -n "$PM_PACKAGES_BUILD" -o -n "$PM_DEL_BUILD_ONLY" ]; then + PM_BUILD_ONLY_LIST=pm_bol + export PM_BUILD_ONLY_LIST + fi fi set -- $newopts @@ -1695,6 +1703,19 @@ update_port () { return 0 } +uniquify_list () { + local item temp_list + + for item in "$@"; do + case "$temp_list" in + *" $item "*) ;; + *) temp_list=" $item $temp_list" ;; + esac + done + + echo $temp_list +} + clean_build_only_list () { local dep temp_bodlg @@ -1705,7 +1726,7 @@ clean_build_only_list () { esac done - build_only_dl_g=" $temp_bodlg " + build_only_dl_g=" `uniquify_list $temp_bodlg` " } dependency_check () { @@ -1736,19 +1757,27 @@ dependency_check () { if [ "$PM_BUILD_ONLY_LIST" = pmp_doing_build_deps ]; then local rundeps dep run_dl build_only_dl - if [ -z "$RECURSE_THOROUGH" ]; then - rundeps=`pm_make run-depends-list | sort -u` + rundeps=`pm_make run-depends-list | sort -u` + if [ -z "$RECURSE_THOROUGH" ]; then for dep in $d_port_list; do case "$rundeps" in - *${dep}*) run_dl="$run_dl $dep" ;; + *${dep}*) +# XXX + varname=`echo ${dep#$pd/} | sed 's#[-+/\.]#_#g'` + rundep_list="$rundep_list $varname" + eval $varname=\"$portdir \$$varname\" + eval ${varname}_p=$dep + eval export $varname ${varname}_p + + run_dl="$run_dl $dep" ;; *) build_only_dl="$build_only_dl $dep" ;; esac done d_port_list="$build_only_dl $run_dl" else - for dep in `pm_make run-depends-list | sort -u`; do + for dep in $rundeps; do run_dl="$run_dl $dep" done build_only_dl=`pm_make build-depends-list | sort -u` @@ -1899,7 +1928,26 @@ post_config () { dep_of_deps=0 if [ -n "$PM_BUILD_ONLY_LIST" ]; then - unset run_dl_g + local var real_rundep deplist dep + + for var in $rundep_list ; do + real_rundep=no + + eval deplist=\$$var + for dep in $deplist ; do + case "$build_only_dl_g" in + *" $pd/$dep "*) ;; + *) real_rundep=yes ; break ;; + esac + done + + [ "$real_rundep" = 'no' ] && + eval build_only_dl_g=\"${build_only_dl_g}\$${var}_p \" + + eval unset $var ${var}_p + done + + unset run_dl_g rundep_list PM_BUILD_ONLY_LIST=pm_bol fi } @@ -2065,8 +2113,8 @@ if [ "$$" -eq "$PM_PARENT_PID" -a -z "$S export CONFIG_SEEN_LIST CONFIG_ONLY NO_DEP_UPDATES if [ -n "$PM_BUILD_ONLY_LIST" ]; then - run_dl_g='' ; build_only_dl_g='' - export run_dl_g build_only_dl_g + run_dl_g='' ; build_only_dl_g='' ; rundep_list='' + export run_dl_g build_only_dl_g rundep_list fi if [ -n "$PM_DEL_BUILD_ONLY" ]; then build_deps_il='' ; export build_deps_il