Conan_Kudo / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone
Blob Blame History Raw
#
# set -o errexit -o noglob are assumed.
#

pre_setup_env() {
	local __;
	if [ -z "${BUILD_CPUS}" ]\
	&& [ -e /proc/cpuinfo ]; then
		BUILD_CPUS=$(awk '/^processor/{cpus++} END{print cpus}' /proc/cpuinfo);
	fi;
	for __ in ${HOME}/midipix_build.vars ../midipix_build.vars ./vars/build.vars; do
		[ -e ${__} ] && . ${__};
	done;
	for __ in $(export | sed -e 's/^export //' -e 's/=.*$//'); do
		if ! lmatch "${CLEAR_ENV_VARS_EXCEPT}" " " "${__}"; then
			unset "${__}";
		fi;
	done;
};

# vim:filetype=sh