1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-06 06:30:19 +00:00

Fix previous attempt to cache some parameters in environment variables.

The quoting was messed up by use of "eval" and the cached values did not
match what the ports system expected.

Submitted by:	tijl
Reported by:	tijl
Approved by:	antoine (implicit)
This commit is contained in:
Stefan Eßer 2018-05-18 17:26:42 +00:00
parent d3016500a5
commit be3e7a0e58
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=470312
2 changed files with 26 additions and 28 deletions

View File

@ -2,7 +2,7 @@
PORTNAME= portmaster
PORTVERSION= 3.19
PORTREVISION= 9
PORTREVISION= 10
CATEGORIES= ports-mgmt
MAINTAINER= se@FreeBSD.org

View File

@ -103,19 +103,17 @@
[ -n "$PM_NO_MAKE_CONFIG" -a -n "$PM_FORCE_CONFIG" ] && unset PM_NO_MAKE_CONFIG
if [ -n "$LIST" -o -n "$LIST_PLUS" ]; then
@@ -927,6 +931,11 @@ if [ "$$" -eq "$PM_PARENT_PID" ]; then
@@ -927,6 +931,9 @@ if [ "$$" -eq "$PM_PARENT_PID" ]; then
fi
fi # [ "$$" -eq "$PM_PARENT_PID" ]
+#=============== cache some build parameters in the environment ===============
+
+export SCRIPTSDIR="$pd/Mk/Scripts"
+eval "$(PORTSDIR="$pd" MAKE=make /bin/sh "$SCRIPTSDIR/ports_env.sh")"
+SCRIPTSDIR="$pd/Mk/Scripts" PORTSDIR="$pd" MAKE=make . "$pd/Mk/Scripts/ports_env.sh" > /dev/null
+
#=============== Begin functions relevant to --features and main ===============
# find installed port for given origin (with optional @flavor) in the pkg DB
@@ -1004,21 +1013,23 @@ get_answer_yn () {
@@ -1004,21 +1011,23 @@ get_answer_yn () {
match_flavor () {
local origin=$(dir_part $1)
@ -143,7 +141,7 @@
}
# Find the new origin for moved ports
@@ -1056,7 +1067,8 @@ find_moved_port () {
@@ -1056,7 +1065,8 @@ find_moved_port () {
fi ;;
${sf}\|*) moved_npd=${moved#*\|} # New port directory
moved_npd=${moved_npd%%\|*}
@ -153,7 +151,7 @@
echo ''
echo " ===>>> The $sf port moved to $moved_npd"
echo " ===>>> Reason: ${moved##*|}"
@@ -1146,11 +1158,10 @@ read_distinfos_all () {
@@ -1146,11 +1156,10 @@ read_distinfos_all () {
echo ''
for origin in ${pd}/*/*; do
@ -166,7 +164,7 @@
if [ -s "${origin}/distinfo" ]; then
distinfo="${origin}/distinfo"
@@ -1377,14 +1388,14 @@ if [ -n "$CHECK_PORT_DBDIR" ]; then
@@ -1377,14 +1386,14 @@ if [ -n "$CHECK_PORT_DBDIR" ]; then
if ! pm_isdir_pd "$origin"; then
find_moved_port $origin $pkg nonfatal >/dev/null
[ -n "$moved_npd" ] || continue
@ -183,7 +181,7 @@
done <<-EOF
$(all_pkgs_by_origin)
EOF
@@ -1502,7 +1513,7 @@ check_for_updates () {
@@ -1502,7 +1511,7 @@ check_for_updates () {
fi
if [ -z "$do_update" -a -z "$skip" -a -z "$PM_INDEX_ONLY" ] && pm_isdir "$pd/$origin"; then
@ -192,7 +190,7 @@
if pm_islocked "$iport"; then
echo " ===>>> Warning: Unable to cd to $pd/$origin"
echo " ===>>> Continuing due to $pdb/$iport/+IGNOREME"
@@ -2175,23 +2186,29 @@ update_pm_nu () {
@@ -2175,23 +2184,29 @@ update_pm_nu () {
}
update_build_l () {
@ -226,7 +224,7 @@
find_new_port "$originflavor" # sets global variable new_port
case `pkg version -t $iport $new_port 2>/dev/null` in
@@ -2203,8 +2220,9 @@ update_build_l () {
@@ -2203,8 +2218,9 @@ update_build_l () {
}
update_port () {
@ -237,7 +235,7 @@
if [ -n "$2" ]; then
echo "===>>> Launching child to update $1 to $2"
else
@@ -2300,7 +2318,7 @@ make_dep_list () {
@@ -2300,7 +2316,7 @@ make_dep_list () {
fail "make_dep_list: Unsupported option '$dep_type'"
esac
done
@ -246,7 +244,7 @@
}
gen_dep_list () {
@@ -2368,15 +2386,17 @@ dependency_check () {
@@ -2368,15 +2384,17 @@ dependency_check () {
rundeps=`gen_dep_list run-depends-list`
for dep in $d_port_list; do
@ -267,7 +265,7 @@
rundep_list="$rundep_list $varname"
eval $varname=\"$portdir \$$varname\"
eval ${varname}_p=$dep
@@ -2409,7 +2429,10 @@ dependency_check () {
@@ -2409,7 +2427,10 @@ dependency_check () {
# Do not export, for THIS parent process only
[ -n "$PM_FIRST_PASS" ] && doing_dep_check=doing_dep_check
@ -279,7 +277,7 @@
origin="${d_port#$pd/}"
if [ -n "$SHOW_WORK" ]; then
iport=`iport_from_origin $origin`
@@ -2429,20 +2452,14 @@ dependency_check () {
@@ -2429,20 +2450,14 @@ dependency_check () {
[ -z "$PM_URB_UP" ] &&
case "$CUR_DEPS" in *:${origin}:*) continue ;; esac
@ -304,7 +302,7 @@
fi
for glob in $conflicts; do
confl_p=`pkg query -g "%n-%v" $glob 2>/dev/null`
@@ -2498,7 +2515,11 @@ dependency_check () {
@@ -2498,7 +2513,11 @@ dependency_check () {
check_for_updates $iport $origin || fail 'Update failed'
else
check_interactive $origin || continue
@ -317,7 +315,7 @@
fi
done
[ -n "$PM_FIRST_PASS" ] && unset doing_dep_check
@@ -2773,8 +2794,8 @@ multiport () {
@@ -2773,8 +2792,8 @@ multiport () {
num=$(( $num + 1 ))
init_term_printf "$port ${num}/${numports}"
@ -328,7 +326,7 @@
[ -n "$update_failed" ] && fail "Update for $port failed"
case "$PM_NEEDS_UPDATE" in
@@ -2823,7 +2844,7 @@ multiport () {
@@ -2823,7 +2842,7 @@ multiport () {
num=$(( $num + 1 ))
init_term_printf "$port ${num}/${numports}"
("$program" $ARGS $port) || update_failed=update_failed
@ -337,7 +335,7 @@
[ -n "$update_failed" ] && fail "Update for $port failed"
done
@@ -3029,8 +3050,12 @@ no_valid_port () {
@@ -3029,8 +3048,12 @@ no_valid_port () {
echo "===>>> Try $progname --help" ; echo '' ; safe_exit 1
}
@ -350,7 +348,7 @@
export_flavor $(flavor_part $portdir)
[ -n "$portdir" ] && { argv=$portdir ; unset portdir; }
argv=${argv:-$1} ; argv=${argv%/} ; argv=`globstrip $argv`
@@ -3061,9 +3086,11 @@ if [ -z "$REPLACE_ORIGIN" ]; then
@@ -3061,9 +3084,11 @@ if [ -z "$REPLACE_ORIGIN" ]; then
unset glob_dirs
fi
unset argv
@ -363,7 +361,7 @@
if [ -z "$PM_INDEX_ONLY" ]; then
pm_isdir_pd "$portdir" ] || missing=missing
else
@@ -3076,7 +3103,7 @@ else
@@ -3076,7 +3101,7 @@ else
echo '' ; no_valid_port
fi
@ -372,7 +370,7 @@
arg2=${2#$pd/} ; arg2=${arg2#$pdb/} ; arg2=${arg2%/}
case "$arg2" in
@@ -3142,8 +3169,9 @@ iport_from_pkgname () {
@@ -3142,8 +3167,9 @@ iport_from_pkgname () {
dir=$(dir_part $1)
flavor=$(flavor_part $1)
@ -384,7 +382,7 @@
}
if [ -z "$upg_port" -a -z "$REPLACE_ORIGIN" ]; then
@@ -3229,11 +3257,14 @@ if [ -n "$PM_FIRST_PASS" -a -z "$FETCH_ONLY" ]; then
@@ -3229,11 +3255,14 @@ if [ -n "$PM_FIRST_PASS" -a -z "$FETCH_ONLY" ]; then
fi
fi
@ -400,7 +398,7 @@
# Do these things first time through
if [ -z "$PM_INDEX_ONLY" -a -z "$PM_BUILDING" -a -z "$SHOW_WORK" -a -z "$NO_ACTION" ]; then
# Do not start this in the background until we are sure we are going to proceed
@@ -3389,7 +3420,7 @@ fetch_package () {
@@ -3389,7 +3418,7 @@ fetch_package () {
export ppd
fi
@ -409,7 +407,7 @@
if [ -z "$FETCH_ARGS" ]; then
FETCH_ARGS=`pm_make -f/usr/share/mk/bsd.port.mk -V FETCH_ARGS 2>/dev/null`
@@ -3636,15 +3667,21 @@ pkg_flavor () {
@@ -3636,15 +3665,21 @@ pkg_flavor () {
pm_make pretty-flavors-package-names | sed -ne 's!^\([A-Za-z0-9_]*\): *'$pkg'$!\1!p';
}
export_flavor=$(pkg_flavor $new_port)
@ -432,7 +430,7 @@
else
[ -z "$local_package" ] && {
fetch_package $latest_pv || fail "Fetch for ${latest_pv}.txz failed"; }
@@ -3808,7 +3845,7 @@ if [ -z "$temp" ] && pm_isdir "$LOCALBASE_COMPAT"; the
@@ -3808,7 +3843,7 @@ if [ -z "$temp" ] && pm_isdir "$LOCALBASE_COMPAT"; the
if [ -n "$files" ]; then
pm_sv Removing old shared libraries, and running ldconfig
@ -441,7 +439,7 @@
$PM_SU_CMD /etc/rc.d/ldconfig start > /dev/null
fi
unset temp file files
@@ -3876,9 +3913,12 @@ if [ -n "$MAKE_PACKAGE" ]; then
@@ -3876,9 +3911,12 @@ if [ -n "$MAKE_PACKAGE" ]; then
fi
if [ -z "$use_package" -a -z "$DONT_POST_CLEAN" ]; then