Project

General

Profile

« Previous | Next » 

Revision 11784

lib/sh/util.sh: import_vars: don't overwrite vars that are already defined, to allow the caller to specify their own values for the vars to create. this requires callers that rely on the overwriting functionality to reverse the order in which they run use_* commands, so that the higher-precedence use_* is applied first and the other one as the default values for the first.

View differences:

util.sh
87 87
declare src_var dest_var
88 88
for src_var in $(get_prefix_vars); do
89 89
	dest_var="${src_var#$prefix}"
90
	declare "$dest_var=${!src_var}"; echo_vars "$dest_var"
90
	declare "$dest_var=${!dest_var-${!src_var}}"; echo_vars "$dest_var"
91 91
done
92 92
EOF
93 93
)"

Also available in: Unified diff