Blame subr/pkg_000000.subr

Lucio Andrés Illanes Albornoz (arab, vxp) 802215
#
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
# set -o errexit -o noglob are assumed.
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
#
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
pkg_000000() {
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
	local _pkg_name_uc _vars_fname _vname _build_uc __ _log_env_vars;
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
	_pkg_name_uc="$(echo ${PKG_NAME} | tr a-z A-Z)";
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
	for _vars_fname in vars/${PKG_NAME}.vars; do
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
		[ -e "${_vars_fname}" ] && . "${_vars_fname}";
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
	done;
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
	for _vname in PREFIX ${PKG_BUILD_VARS}; do
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
		_build_uc="$(echo ${BUILD} | tr a-z A-Z)";
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
		for __ in "DEFAULT_${_vname}"			\
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
			  "${BUILD_TARGET}_${_vname}"		\
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
			  "PKG_${_pkg_name_uc}_${_vname}"	\
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
			  "PKG_${_pkg_name_uc}_${_vname}_${_build_uc}"; do
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
			set_var_unsafe "PKG_${_vname}" "$(get_var_unsafe ${__})";
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
		done;
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
	done;
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
	if [ -z "${PKG_URL}" -a -z "${PKG_URLS_GIT}" -a -z "${PKG_VERSION}" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
		log_msg failexit "Error: package \`${PKG_NAME}' missing in build.vars.";
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
	else
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
		[ -n "${PKG_ENV_VARS_EXTRA}" ] && set_env_vars_with_sep : "${PKG_ENV_VARS_EXTRA}";
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
		[ -z "${PKG_FNAME}" ] && PKG_FNAME="${PKG_URL##*/}";
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
		[ -z "${PKG_SUBDIR}" ] && PKG_SUBDIR="${PKG_FNAME%%.tar*}";
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
		[ -z "${PKG_TARGET}" ] && PKG_TARGET="${TARGET}";
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
		[ -z "${MIDIPIX_BUILD_PWD}" ] && MIDIPIX_BUILD_PWD="$(pwd)";
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
	for __ in $(set); do
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
		if [ "${__#PKG_${_pkg_name_uc}}" != "${__}" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
			_log_env_vars="${_log_env_vars:+${_log_env_vars} }${__%%=*}";
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
		fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
	done;
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
	if [ -n "${_log_env_vars}" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
 		log_env_vars "build" ${_log_env_vars};
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) dc3ef5
	build_fileop cd "${WORKDIR}";
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
};
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
# vim:filetype=sh