summaryrefslogtreecommitdiffhomepage
path: root/subr/pkg_fetch_clean.subr
blob: 5279706809fc2a14f5ea1b199cd8b17a1645ef3d (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_fileop 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