Conan_Kudo / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone

Blame subr/pkg_clean.subr

Lucio Andrés Illanes Albornoz (arab, vxp) 19ab70
#
Lucio Andrés Illanes Albornoz e1d469
# set +o errexit -o noglob -o nounset is assumed.
Lucio Andrés Illanes Albornoz (arab, vxp) 19ab70
#
Lucio Andrés Illanes Albornoz (arab, vxp) 19ab70
Lucio Andrés Illanes Albornoz (arab, vxp) 19ab70
pkg_clean() {
Lucio Andrés Illanes Albornoz 2b85d0
	if [ "${PKG_NO_CLEAN:-0}" -eq 0 ]; then
Lucio Andrés Illanes Albornoz c6d6e0
		if rtl_lmatch "${ARG_CLEAN_BUILDS}" "build" ","; then
Lucio Andrés Illanes Albornoz bf9edf
			if ! rtl_fileop rm "${PKG_BUILD_DIR}"; then
Lucio Andrés Illanes Albornoz bf9edf
				return 1;
Lucio Andrés Illanes Albornoz bf9edf
			fi;
Lucio Andrés Illanes Albornoz 2b85d0
		fi;
Lucio Andrés Illanes Albornoz c6d6e0
		if rtl_lmatch "${ARG_CLEAN_BUILDS}" "dest" ","; then
Lucio Andrés Illanes Albornoz bf9edf
			if ! rtl_fileop rm "${PKG_DESTDIR}"; then
Lucio Andrés Illanes Albornoz bf9edf
				return 1;
Lucio Andrés Illanes Albornoz 8a4e16
			elif [ -e "${PKG_DESTDIR_HOST}" ]\
Lucio Andrés Illanes Albornoz 8a4e16
			&&   ! rtl_fileop rm "${PKG_DESTDIR_HOST}"; then
Lucio Andrés Illanes Albornoz 8a4e16
				return 1;
Lucio Andrés Illanes Albornoz bf9edf
			fi;
Lucio Andrés Illanes Albornoz 2b85d0
		fi;
Lucio Andrés Illanes Albornoz c6d6e0
		if rtl_lmatch "${ARG_CLEAN_BUILDS}" "src" ","; then
Lucio Andrés Illanes Albornoz bf9edf
			if ! rtl_fileop rm "${PKG_BASE_DIR}/${PKG_SUBDIR}"; then
Lucio Andrés Illanes Albornoz bf9edf
				return 1;
Lucio Andrés Illanes Albornoz bf9edf
			fi;
Lucio Andrés Illanes Albornoz 2b85d0
		fi;
Lucio Andrés Illanes Albornoz 0eaee4
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 19ab70
};
Lucio Andrés Illanes Albornoz (arab, vxp) 19ab70
Lucio Andrés Illanes Albornoz (arab, vxp) 19ab70
# vim:filetype=sh