midipix / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone

Blame subr/pre_setup_env.subr

Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
#
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
# set -o errexit -o noglob are assumed.
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
#
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
pre_setup_env() {
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
	local __;
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
	if [ -z "${BUILD_CPUS}" ]\
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
	&& [ -e /proc/cpuinfo ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
		BUILD_CPUS=$(awk '/^processor/{cpus++} END{print cpus}' /proc/cpuinfo);
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
	for __ in ${HOME}/midipix_build.vars ../midipix_build.vars ./vars/build.vars; do
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
		[ -e ${__} ] && . ${__};
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
	done;
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
	for __ in $(export | sed -e 's/^export //' -e 's/=.*$//'); do
Lucio Andrés Illanes Albornoz (arab, vxp) 51fbc3
		if ! lmatch "${CLEAR_ENV_VARS_EXCEPT}" " " "${__}"; then
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
			unset "${__}";
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
		fi;
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
	done;
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
};
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
Lucio Andrés Illanes Albornoz (arab, vxp) e2fea1
# vim:filetype=sh