Blame dist/dist_zipdist.dist

Lucio Andrés Illanes Albornoz 36c4a8
#
8d7a8a
# Copyright (c) 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 LucĂ­a Andrea Illanes Albornoz <lucia@luciaillanes.de>
Lucio Andrés Illanes Albornoz e1d469
# set +o errexit -o noglob -o nounset is assumed.
Lucio Andrés Illanes Albornoz 36c4a8
#
Lucio Andrés Illanes Albornoz 36c4a8
Lucio Andrés Illanes Albornoz efeeb0
pkg_dist_zipdist_all() {
e9fa07
	local	_pdza_group_name="${1}" _pdza_pkg_name="${2}" _pdza_restart_at="${3}"	\
e9fa07
		_pdza_dist_fname="" _pdza_pkg_name="" _pdza_pkglist_fname="${PREFIX}/pkglist.native";
e9fa07
e9fa07
	if ! rtl_lmatch \$ARG_DIST "zipdist" ","; then
e9fa07
		return 0;
e9fa07
	fi;
e9fa07
670f66
	ex_pkg_dispatch_send "msg_pkg" "dist" "dist_zipdist" "${MSG_zipdist_begin}";
4243a1
	rtl_log_msgV "zipdist" "${MSG_zipdist_begin}";
e9fa07
e9fa07
	for _pdza_pkg_name in $(cat "${_pdza_pkglist_fname}"); do
e9fa07
		if [ ! -e "${BUILD_WORKDIR}/${_pdza_pkg_name}-native-${DEFAULT_TARGET}" ]; then
4243a1
			rtl_log_msgV "fatalexit" "${MSG_zipdist_missing_pkg_build_dir}" "${_pdza_pkg_name}";
e9fa07
		fi;
e9fa07
	done;
e9fa07
e9fa07
	_pdza_dist_fname="${DEFAULT_ZIPDIST_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.zip";
e9fa07
e9fa07
	if [ -e "${BUILD_WORKDIR}/zipdist" ]\
e9fa07
	&& ! rtl_fileop rm "${BUILD_WORKDIR}/zipdist"; then
e9fa07
		return 1;
e9fa07
	elif ! rtl_fileop mkdir "${BUILD_WORKDIR}/zipdist"; then
e9fa07
		return 1;
e9fa07
	elif ! "${BUILD_WORKDIR}/mpackage/mpackage.sh"				\
e9fa07
			--defroot="${DEFAULT_ZIPDIST_DEFROOT}"			\
e9fa07
			--flysyms						\
e9fa07
			--minroot="${PREFIX_MINIPIX}"				\
e9fa07
			--objroot="${BUILD_WORKDIR}"				\
e9fa07
			--pkgroot="${BUILD_WORKDIR}/zipdist/pkgroot"		\
e9fa07
			--product=Midipix					\
e9fa07
			--subset="${_pdza_pkglist_fname}"			\
e9fa07
			--symbols						\
e9fa07
			--sysroot="${BUILD_WORKDIR}/zipdist/sysroot"		\
e9fa07
			--target="${DEFAULT_TARGET}"				\
e9fa07
			--tmproot="${BUILD_WORKDIR}/zipdist/tmproot"		\
e9fa07
			--zipfile="${PREFIX}/${_pdza_dist_fname}"; then
e9fa07
		return 1;
e9fa07
	fi;
e9fa07
670f66
	ex_pkg_dispatch_send "msg_pkg" "dist" "dist_zipdist" "${MSG_zipdist_finished}";
4243a1
	rtl_log_msgV "zipdist" "${MSG_zipdist_finished}";
e9fa07
e9fa07
	if [ "${DEFAULT_ZIPDIST_SIGN_GPG_KEY:+}" = 1 ]\
e9fa07
	&& command which gpg >/dev/null 2>&1\
e9fa07
	&& gpg --list-keys "${DEFAULT_ZIPDIST_SIGN_GPG_KEY}" >/dev/null 2>&1;
e9fa07
	then
670f66
		ex_pkg_dispatch_send "msg_pkg" "dist" "dist_zipdist" "${MSG_zipdist_signing}";
4243a1
		rtl_log_msgV "zipdist" "${MSG_zipdist_signing}";
e9fa07
e9fa07
		if ! gpg --armor --passphrase-file /dev/null		\
e9fa07
			--local-user "${DEFAULT_ZIPDIST_SIGN_GPG_KEY}"	\
e9fa07
			--sign "${PREFIX}/${_pdza_dist_fname}"; then
Lucio Andrés Illanes Albornoz bf9edf
			return 1;
Lucio Andrés Illanes Albornoz 86373a
		fi;
e9fa07
670f66
		ex_pkg_dispatch_send "msg_pkg" "dist" "dist_zipdist" "${MSG_zipdist_signed}";
4243a1
		rtl_log_msgV "zipdist" "${MSG_zipdist_signed}";
Lucio Andrés Illanes Albornoz 36c4a8
	fi;
e9fa07
670f66
	ex_pkg_dispatch_send "step" "${_pdza_group_name}" "${_pdza_pkg_name}" "finish";
8857c4
	ex_pkg_state_set "${_pdza_pkg_name}" "finish";
8857c4
e9fa07
	return 0;
Lucio Andrés Illanes Albornoz 36c4a8
};
Lucio Andrés Illanes Albornoz 36c4a8
64844b
# vim:filetype=sh textwidth=0