summaryrefslogtreecommitdiffhomepage
path: root/subr.pkg/pkg_configure_clean.subr
blob: 3dba1036ca322e8ad366d6190e539db04b7318c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#
# Copyright (c) 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Lucía Andrea Illanes Albornoz <lucia@luciaillanes.de>
# set +o errexit -o noglob -o nounset is assumed.
#

pkg_configure_clean() {
	local _pcc_group_name="${1}" _pcc_pkg_name="${2}" _pcc_restart_at="${3}";

	if ex_pkg_state_test									\
			"${_pcc_pkg_name}"							\
			"configure_patch_pre,configure_autotools,configure_patch,configure"	\
			"${_pcc_restart_at}"\
	&& [ "${PKG_BUILD_DIR:-}" != "${PKG_SUBDIR:-}" ];
	then
		rtl_fileop rm "${PKG_BUILD_DIR}" || return 1;
		rtl_fileop mkdir "${PKG_BUILD_DIR}" || return 1;
		rtl_fileop cd "${PKG_BUILD_DIR}" || return 1;
	fi;
	return 0;
};

# vim:filetype=sh textwidth=0