svn commit: r201245 - user/dougb/portmaster
Doug Barton
dougb at FreeBSD.org
Wed Dec 30 03:59:45 UTC 2009
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
More information about the svn-src-user
mailing list