summaryrefslogtreecommitdiffhomepage
path: root/subr/pkg_fetch_clean.subr
blob: a56196cb85b415666588747b102997f70b744574 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#
# set +o errexit -o noglob -o nounset is assumed.
#

pkg_fetch_clean() {
	local _dname="";

	if [ -n "${PKG_URLS_GIT:-}" ]; then
		if [ -n "${PKG_SUBDIR:-}" ]\
		&& [ "${PKG_SUBDIR}" != "${PKG_URLS_GIT%%=*}" ]; then
			rtl_fileopm rm "${PKG_SUBDIR}";
		fi;
		for _dname in ${PKG_URLS_GIT}; do
			_dname="${_dname%%=*}"; rtl_fileop rm "${_dname}";
		done;
	elif [ -n "${PKG_SUBDIR}" ]; then
		rtl_fileop rm "${PKG_SUBDIR}";
	fi; return 0;
};

# vim:filetype=sh