Blame subr/build_args.subr

Lucio Andrés Illanes Albornoz (arab, vxp) 0185bc
#
Lucio Andrés Illanes Albornoz (arab, vxp) 0185bc
# set -o noglob is assumed.
Lucio Andrés Illanes Albornoz (arab, vxp) 0185bc
#
Lucio Andrés Illanes Albornoz (arab, vxp) 0185bc
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
build_args() {
Lucio Andrés Illanes Albornoz 8c791c
	local _opt="";
Lucio Andrés Illanes Albornoz 8c791c
	while getopts a:Ab:C:dD:FhPr:Rv _opt; do
Lucio Andrés Illanes Albornoz 8c791c
	case "${_opt}" in
Lucio Andrés Illanes Albornoz 8c791c
	a)	ARCH="${OPTARG}"; ;;
Lucio Andrés Illanes Albornoz 8c791c
	A)	ARG_AS_NEEDED=1; ;;
Lucio Andrés Illanes Albornoz 8c791c
	b)	BUILD="${OPTARG}"; ;;	
Lucio Andrés Illanes Albornoz 8c791c
	C)	ARG_CLEAN_BUILDS="${OPTARG}"; ;;
Lucio Andrés Illanes Albornoz 8c791c
	d)	ARG_DEBUG_MINIPIX=1; ;;
Lucio Andrés Illanes Albornoz 8c791c
	D)	ARG_DIST="${OPTARG}"; ;;
Lucio Andrés Illanes Albornoz 8c791c
	F)	ARG_FETCH_FORCE=1; ;;
Lucio Andrés Illanes Albornoz 8c791c
	h)	cat etc/build.usage; exit 0; ;;
Lucio Andrés Illanes Albornoz 8c791c
	P)	ARG_PARALLEL="${OPTARG:-auto}"; ;;
Lucio Andrés Illanes Albornoz 8c791c
	r)	ARG_RESTART="${OPTARG}"; ;;
Lucio Andrés Illanes Albornoz 8c791c
	R)	ARG_RELAXED=1; ;;
Lucio Andrés Illanes Albornoz 8c791c
	v)	: $((ARG_VERBOSE+=1)); ;;
Lucio Andrés Illanes Albornoz 8c791c
	*)	cat etc/build.usage; exit 1; ;;
Lucio Andrés Illanes Albornoz 8c791c
	esac; done; shift $((${OPTIND}-1));
Lucio Andrés Illanes Albornoz 8c791c
	if ex_rtl_lmatch "${ARG_DIST}" , zipdist\
Lucio Andrés Illanes Albornoz 8c791c
	&& ! ex_rtl_lmatch "${ARG_DIST}" , minipix; then
Lucio Andrés Illanes Albornoz 8c791c
		ARG_DIST="${ARG_DIST:+${ARG_DIST},}minipix";
Lucio Andrés Illanes Albornoz 8c791c
	fi;
Lucio Andrés Illanes Albornoz 8c791c
	if [ -n "${ARG_RESTART}" ]\
Lucio Andrés Illanes Albornoz 8c791c
	&& [ "${ARG_RESTART#\*}" != "${ARG_RESTART}" ]; then
Lucio Andrés Illanes Albornoz 8c791c
		ARG_RESTART="${ARG_RESTART#\*}"; ARG_RESTART_RECURSIVE=1;
Lucio Andrés Illanes Albornoz f84af6
	fi;
Lucio Andrés Illanes Albornoz cc86a5
	case "${ARG_RESTART}" in
Lucio Andrés Illanes Albornoz cc86a5
	ALL)	ARG_RESTART_AT=ALL; ;;
Lucio Andrés Illanes Albornoz cc86a5
	LAST)	ARG_RESTART_AT=""; ;;
Lucio Andrés Illanes Albornoz cc86a5
	"")	;;
Lucio Andrés Illanes Albornoz cc86a5
	*)	if [ "${ARG_RESTART%:*}" != "${ARG_RESTART}" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) f6a5cb
			ARG_RESTART_AT="${ARG_RESTART#*:}"; ARG_RESTART="${ARG_RESTART%:*}";
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		else
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
			ARG_RESTART_AT=ALL;
Lucio Andrés Illanes Albornoz (arab, vxp) f6a5cb
		fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 19ab70
		ARG_RESTART="$(echo "${ARG_RESTART}" | sed "s/,/ /g")";
Lucio Andrés Illanes Albornoz cc86a5
		;;
Lucio Andrés Illanes Albornoz cc86a5
	esac;
Lucio Andrés Illanes Albornoz (arab, vxp) f6a5cb
	while [ ${#} -gt 0 ]; do
Lucio Andrés Illanes Albornoz (arab, vxp) f6a5cb
	case "${1}" in
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
	*=*)	ex_rtl_set_var_unsafe "${1%%=*}" "${1#*=}"; ;;
Lucio Andrés Illanes Albornoz b96c60
	*)	BUILD_GROUPS="${BUILD_GROUPS:+${BUILD_GROUPS} }${1}"; ;;
Lucio Andrés Illanes Albornoz (arab, vxp) f6a5cb
	esac; shift; done;
Lucio Andrés Illanes Albornoz (arab, vxp) f6a5cb
};
Lucio Andrés Illanes Albornoz (arab, vxp) f6a5cb
Lucio Andrés Illanes Albornoz (arab, vxp) f6a5cb
# vim:filetype=sh