Blob Blame History Raw
#
# set -o noglob is assumed.
#

build_args() {
	local _opt="";
	while getopts a:Ab:C:dD:FhPr:Rv _opt; do
	case "${_opt}" in
	a)	ARCH="${OPTARG}"; ;;
	A)	ARG_AS_NEEDED=1; ;;
	b)	BUILD="${OPTARG}"; ;;	
	C)	ARG_CLEAN_BUILDS="${OPTARG}"; ;;
	d)	ARG_DEBUG_MINIPIX=1; ;;
	D)	ARG_DIST="${OPTARG}"; ;;
	F)	ARG_FETCH_FORCE=1; ;;
	h)	cat etc/build.usage; exit 0; ;;
	P)	ARG_PARALLEL="${OPTARG:-auto}"; ;;
	r)	ARG_RESTART="${OPTARG}"; ;;
	R)	ARG_RELAXED=1; ;;
	v)	: $((ARG_VERBOSE+=1)); ;;
	*)	cat etc/build.usage; exit 1; ;;
	esac; done; shift $((${OPTIND}-1));
	if ex_rtl_lmatch "${ARG_DIST}" , zipdist\
	&& ! ex_rtl_lmatch "${ARG_DIST}" , minipix; then
		ARG_DIST="${ARG_DIST:+${ARG_DIST},}minipix";
	fi;
	if [ -n "${ARG_RESTART}" ]\
	&& [ "${ARG_RESTART#\*}" != "${ARG_RESTART}" ]; then
		ARG_RESTART="${ARG_RESTART#\*}"; ARG_RESTART_RECURSIVE=1;
	fi;
	case "${ARG_RESTART}" in
	ALL)	ARG_RESTART_AT=ALL; ;;
	LAST)	ARG_RESTART_AT=""; ;;
	"")	;;
	*)	if [ "${ARG_RESTART%:*}" != "${ARG_RESTART}" ]; then
			ARG_RESTART_AT="${ARG_RESTART#*:}"; ARG_RESTART="${ARG_RESTART%:*}";
		else
			ARG_RESTART_AT=ALL;
		fi;
		ARG_RESTART="$(echo "${ARG_RESTART}" | sed "s/,/ /g")";
		;;
	esac;
	while [ ${#} -gt 0 ]; do
	case "${1}" in
	*=*)	ex_rtl_set_var_unsafe "${1%%=*}" "${1#*=}"; ;;
	*)	BUILD_GROUPS="${BUILD_GROUPS:+${BUILD_GROUPS} }${1}"; ;;
	esac; shift; done;
};

# vim:filetype=sh